I have a client that is mandating that my required
string elements have nillable="false"
, currently all strings in the wsdl come out will nillable="true"
, IE:
<xs:element name="username" nillable="true" type="xs:string" />
How can i change the nillable="false"
?!? I will take any suggestions on how to do this? Am I the first person that has run into this?
How is this element defined in your data contract?
If it's not already done, try adding a IsRequired=true
clause to the data member attribute:
[DataContract]
class YourDataStructure
{
......
[DataMember(IsRequired=True)]
string username;
.....
}
Other than that, I'm not aware of any way to influence the XSD being rendered from your WCF data contract, short of writing your own WsdlExporter extension (which is totally possible - just seems a bit overkill here).
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