In my WCF Service I have a function, for example:
bool ValidateLogin(string user, string password)
after I hosted it in windows azure and add references into my web app, that function became:
bool ValidateLogin(string user, string password, out int ValidateLoginResult, out bool ValidateLoginResultSpecified)
Does anyone know what these two parameters are? And how can I prevent it being added after hosting?
Setting the XmlSerializerFormat Style to RPC did the trick for me. I.e.
[OperationContract, XmlSerializerFormat(Style = OperationFormatStyle.Rpc)]
bool ValidateLogin(string user, string password)
It changes the way the wsdl is generated, from:
<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>
To:
<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>
This article propose a different solution, but also contains some extra explanations: http://www.codeproject.com/Articles/323097/WCF-ASMX-Interoperability-Removing-the-Annoying-xx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With