添加服务参考时的沮丧 [英] Frustration when Add Service Reference

查看:79
本文介绍了添加服务参考时的沮丧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我为什么,当我为使用[MessageContract]作为属性的WCF服务方法生成ServiceReference时,会创建[MessageContract]的2个版本,但会附加两个版本与1?

Can anyone tell me why, when I generate a ServiceReference for a WCF service method that uses a [MessageContract] as it's attribute, it creates 2 versions of the [MessageContract] buts appends one of them with 1?

例如方法如下:

MessageResponse DoWork(MessageRequest请求)

在客户端上生成Reference.cs时,方法 DoWork(...) 期望的属性类型为 MessageRequest1 >(已生成),也没有生成 MessageRequest 类型的.

When Reference.cs gets generated on the client the method DoWork(...) is expecting an attribute of type MessageRequest1 (which has been generated), not of type MessageRequest has also been generated.

谢谢

 

推荐答案

斯科特,

看看您的消息合同的iswrapped属性.我认为您的请求消息合同的属性为iswrapped = true,而您的响应将其设置为false.将响应的属性设置为true,它将被修复.

Take a look at the iswrapped property of your message contract. I think that your request message contract has the property iswrapped=true and your response has it set to false. Set the property of your response tot true and it will be fixed.

此致

丹尼斯


这篇关于添加服务参考时的沮丧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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