wcf - WCF 服务中的 *Result 和 *ResultSpecified 参数?

标签 wcf

在我的 WCF 服务中我有一个函数,例如:

bool ValidateLogin(string user, string password)

在我将其托管在 windows azure 中并将引用添加到我的网络应用程序之后,该函数变为:

bool ValidateLogin(string user, string password, out int ValidateLoginResult, out bool ValidateLoginResultSpecified)

有谁知道这两个参数是什么?以及如何防止在托管后添加它?

最佳答案

将 XmlSerializerFormat 样式设置为 RPC 对我有用。 IE。

[OperationContract, XmlSerializerFormat(Style = OperationFormatStyle.Rpc)]
bool ValidateLogin(string user, string password)

它改变了 wsdl 的生成方式,来自:

<wsdl:message name="IService_ValidateLogin_InputMessage">
    <wsdl:part name="parameters" element="tns:ValidateLogin" />
</wsdl:message>
<wsdl:message name="IService_ValidateLogin_OutputMessage">
    <wsdl:part name="parameters" element="tns:ValidateLoginResponse" />
</wsdl:message>

收件人:

<wsdl:message name="IService_ValidateLogin_InputMessage">
    <wsdl:part name="user" type="xsd:string" />
    <wsdl:part name="password" type="xsd:string" />
</wsdl:message>
<wsdl:message name="IService_ValidateLogin_OutputMessage">
    <wsdl:part name="ValidateLoginResult" type="xsd:boolean" />
</wsdl:message>

这篇文章提出了一个不同的解决方案,但也包含一些额外的解释:http://www.codeproject.com/Articles/323097/WCF-ASMX-Interoperability-Removing-the-Annoying-xx

关于wcf - WCF 服务中的 *Result 和 *ResultSpecified 参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8123590/

相关文章:

wcf - 记录 ClientBase 对象接收的 SOAP 原始响应

c# - 一个 WCF 服务可以返回另一个吗?

c# - 不同的 WCF 绑定(bind),它们的区别以及与其他平台的兼容性

javascript - Sys.Net.WebServiceProxy 的定义位置

c# - 验证 WCF 和 WebService 方法参数值的最佳方式

.net - 如何摆脱 VS2008 中的 "The target assembly contains no service types"错误消息?

visual-studio - WCF 64 位不起作用

linux - WCF 服务能否向基于 Linux 的 C++ 客户端应用程序提供发布/订阅事件?

c# - WCF 服务中无法在表 '' 错误中插入标识列的显式值

c# - 使用 wshttpbinding 和用户名身份验证保护服务时,WCF 服务显示异常