I am curious about the way a non-.NET client application of a WCF service can signal to a given method that it doesn't want to specify a value for a given parameter (making the service then assuming a default value). In other words, how can an application signal a null
parameter to a WCF service?
It can exclude the parameter from the SOAP document (assuming HTTP endpoint), assuming this is allowed.
Exactly if this is allowed/how this should be done depends on how the XSD is generated.
These can be controlled by the arguments to the [DataMember]
attribute.
If [DataMember(IsRequired=true)]
MSDN then the xml will be required to contain this element (minOccurs will be 1 I believe), and if the element may be nillable (nillable=true, depending on datatype)
If [DataMember(EmitDefaultValue=true)]
MSDN then there will be an element if the element has its default value when the item is serialized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With