另一个添加服务参考“创建消息合同(请求/响应对象) [英] Another Add service reference" Creates Message Contracts (Request/Response objects)

查看:75
本文介绍了另一个添加服务参考“创建消息合同(请求/响应对象)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有些人问了类似的问题。但我的情况是,当我创建wcf服务时,一切都很好。我的方法没有使用[DataContract]类型作为我的对象。我只有一个带void返回的简单方法,参数是一个字符串。我
没有使用消息合约,只是使用[OperationContract]为什么当我添加服务引用时,它给了我该方法的消息合同。而且我没有检查"始终生成消息合同"。框。任何解决方案?

解决方案

嗨Helen,因为wcf需要消息合同才能工作,如果你还没有得到OperationContract可能你没有得到消息合同,但你也无法访问你的方法。


我的2美分。


最好的问候。


I know some people asked similar question. But my case is when I created wcf service everything is fine. And I did not use the [DataContract] type for my object for my methods. I just have a simple method with void return and argument is one string. I did not use message contract, just use [OperationContract] why when I added service reference, it gave me message contract for that method.And I did not check "Always generating message contract" box. Any solution?

解决方案

Hi Helen, because message contract is required for wcf to work, if you haven't got OperationContract may be you haven't got message contract but you haven't got access to your method, too.

My 2 cents.

Best regards.


这篇关于另一个添加服务参考“创建消息合同(请求/响应对象)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆