*WCF服务中的结果和*ResultSpecified参数?

Ken*_*ent 3 wcf

在我的WCF服务中,我有一个功能,例如:

bool ValidateLogin(string user, string password)
Run Code Online (Sandbox Code Playgroud)

在我在windows azure中托管它并将引用添加到我的Web应用程序后,该功能变为:

bool ValidateLogin(string user, string password, out int ValidateLoginResult, out bool ValidateLoginResultSpecified)
Run Code Online (Sandbox Code Playgroud)

有谁知道这两个参数是什么?我怎样才能阻止它在托管后添加?

小智 6

将XmlSerializerFormat样式设置为RPC对我来说是个窍门.即

[OperationContract, XmlSerializerFormat(Style = OperationFormatStyle.Rpc)]
bool ValidateLogin(string user, string password)
Run Code Online (Sandbox Code Playgroud)

它改变了生成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>
Run Code Online (Sandbox Code Playgroud)

至:

<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>
Run Code Online (Sandbox Code Playgroud)

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