在我的 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/