Craig Main

Hi,

I am using basicHttpBinding to create a WCF service that is being consumed from a Studio 2005 web service reference.

All the scalar arguments to the method calls are accompanied by a bunch of horrible IsSpecified boolean arguments. If I wanted such a cludgy interface I would have added the booleans myself

How do I specify that these arguments are in fact not optional

The client code looks terrible. I wish to make the service nicely backward compatible. I have tried adding [WebMethod] attributes as it was suggested that it would help, but alas, it does not.

Thanks

Regards

Craig



Re: Windows Communication Foundation (Indigo) Optional arguments consuming WCF service.

Nathan Anderson - MSFT

Here's a blog post on this behavior:

http://blogs.msdn.com/eugeneos/archive/2007/02/05/solving-the-disappearing-data-issue-when-using-add-web-reference-or-wsdl-exe-with-wcf-services.aspx

The short answer is to use IsRequired=true in your DataContract:

Code Snippet

[DataContract]

public class Route

{

[DataMember(IsRequired=true)]

public int zipCodeFrom;

[DataMember(IsRequired=true)]

public int zipCodeTo;

}

Hope this helps.