WCF: Is there a way to find out if the client passed a specific optional property or not?

When a client makes a call to a wcf service, Is there a way to find out whether a specific property of an object was send passed in the call or not.

ClassA

{

[DataMember(IsRequired=true)]

public int id{}

[DataMember(IsRequired=false)]

public string name{}
}

When a client makes a call to a service method passing an instance of the above class as a parameter, Is there a way to intimate the service that the "name" property is empty

Thanks!



Answer this question

WCF: Is there a way to find out if the client passed a specific optional property or not?

  • zeifer

    I want the client to set the value if they have it. On the service side, I want to know if the client has set a value for the prperty or not.

  • Visual C# Novice

    Can you change the public field as a public property and have set/get for a private String m_Name = String.Empty;



  • WCF: Is there a way to find out if the client passed a specific optional property or not?