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?
Add or replace the following code above your IService Interface :
Source
In your client project, ensure that you chosen 'Add Service Reference' instead of 'Add Web Reference'. 'Add Service Reference' uses WCF while 'Add Web Reference' does not and compensates for optional parameters by adding the '[paramName]Specified' additional parameters.
How are you adding the WCF to your client app? This looks like it's nothing to do with Azure - it's more to do with how you've defined your
[DataContract]
and how it's imported into your client code.I think if you use WCF on the client side then you won't see these additional parameters.
See a possible explanation (or a possibly related issue) here - http://blogs.msdn.com/b/eugeneos/archive/2007/02/05/solving-the-disappearing-data-issue-when-using-add-web-reference-or-wsdl-exe-with-wcf-services.aspx
Setting the XmlSerializerFormat Style to RPC did the trick for me. I.e.
It changes the way the wsdl is generated, from:
To:
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
Worked fine for me as below code:
Apparently, this comes from the WSDL generator, in this case used on the "Add Web Reference..." option of VS 2005:
http://devpinoy.org/blogs/cruizer/archive/2008/10/05/some-wcf-gotchas.aspx
The answer on the MSDN forums also hints at legacy support:
http://social.msdn.microsoft.com/Forums/en/windowsazure/thread/406a6b6b-9dab-469d-ad0f-1f8f95cf0656
So my answer, I'm going to guess your client is .NET 2?