* Result and * ResultSpecified parameters in WCF service?

In my WCF service, I have a function like:

bool ValidateLogin(string user, string password)

after I placed it in azure windows and added links to my web application, this function became:

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

Does anyone know what these two options are? And how can I prevent it from being added after hosting?

+3
source share
6 answers

Apparently this comes from the WSDL generator, in which case the option "Add Web Link ..." is used for VS 2005:

http://devpinoy.org/blogs/cruizer/archive/2008/10/05/some-wcf-gotchas.aspx

In the answers on the forums, MSDN also hints at outdated support:

http://social.msdn.microsoft.com/Forums/en/windowsazure/thread/406a6b6b-9dab-469d-ad0f-1f8f95cf0656

, , , -.NET 2?

+4

XmlSerializerFormat RPC .

[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>

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>

, : http://www.codeproject.com/Articles/323097/WCF-ASMX-Interoperability-Removing-the-Annoying-xx

+6

Add or replace the following code above your IService interface:

[ServiceContract ( Namespace="http://www.yoursite.com/"),XmlSerializerFormat]

Source

+1
source

Worked fine for me as below:

[ServiceContract]
[XmlSerializerFormat]
public interface IService1
{
   // do code here
}
+1
source

In your client project, make sure that you select "Add Service Link" instead of "Add Web Link." Add Service Link uses WCF, and Add Web Link does not fulfill or compensate for optional parameters by adding additional parameters [paramName] Specified.

0
source

All Articles