CodePrairie .NET

South Dakota .NET User Group


WCF Lessons

Consider a datacontract like this:

   public class CreateAccountRequest
      private string _accountNumber;
      private string _accountGroupCode;
      private AccountProfile _profile;
      private Contact _billingContact;

      public string AccountNumber
         get { return _accountNumber; }
         set { _accountNumber = value; }

      public string AccountGroupCode
         get { return _accountGroupCode; }
         set { _accountGroupCode = value; }

When passing this as an argument from a WCF client to a WCF service I would expect an exception if i don't explicitly set the AccountGroupCode property. However this is not the behavior because the WCF client is smart enough to pass the element in the XML it is really only to ensure a caller from some other library (ASMX, Java etc) supplys the element.

Published May 11 2007, 01:49 PM by chrisortman
Filed under: ,


No Comments

Leave a Comment

Powered by Community Server (Commercial Edition), by Telligent Systems