E
Erik Klein
I have a WebService whose WSDL contains the following snippet:
<complexType abstract="true" name="Type">
<sequence>
<element name="localId" nillable="true" type="xsd:string"/>
<element name="id" minOccurs="0" maxOccurs="1" nillable="true"
type="xsd:int"/>
</sequence>
</complexType>
When I run wsdl.exe against this, the following C# code is generated:
public abstract class Type {
public string localId;
public int id;
}
Unfortunately, the "id" element is incapable of holding null / nil
values because it is a Value Type (int). If the client specifies
nothing, the value sent is zero(0) which is incorrect and violates the
XML Schema.
I will be providing this WSDL to my clients ... they will be building
their own Web Service Clients using tools including wsdl.exe.
How do I workaround wsdl.exe's apparant "lack of support" for
'nillable="true"' and 'minOccurs="0"'?
Thanks in advance.
<complexType abstract="true" name="Type">
<sequence>
<element name="localId" nillable="true" type="xsd:string"/>
<element name="id" minOccurs="0" maxOccurs="1" nillable="true"
type="xsd:int"/>
</sequence>
</complexType>
When I run wsdl.exe against this, the following C# code is generated:
public abstract class Type {
public string localId;
public int id;
}
Unfortunately, the "id" element is incapable of holding null / nil
values because it is a Value Type (int). If the client specifies
nothing, the value sent is zero(0) which is incorrect and violates the
XML Schema.
I will be providing this WSDL to my clients ... they will be building
their own Web Service Clients using tools including wsdl.exe.
How do I workaround wsdl.exe's apparant "lack of support" for
'nillable="true"' and 'minOccurs="0"'?
Thanks in advance.