wcf service don't send element even the service xsd element has minOccurs and nillable in default values



I have a service that in the xsd section define and element as follows:



<xsd:element ref="data" />
...
<xsd:element name="data" type="xsd:string" />


so since the element is not specifing the minOccurs and nillable attributes then they have the default values, 1 and false respectively.


We are presuming that even if the wcf proxy class we set the data field in null the soap message must contain the element as the service expects but in our test the message did'nt has the element, so the service return fail because it not conforms the schema.


The expected message:



<InteractionResults xmlns="">
<InteractionResult>
<data/>
</InteractionResult>
</InteractionResults>


The message sent



<InteractionResults xmlns="">
<InteractionResult/>
</InteractionResults>


We are assuming something wrong or maybe could be a wcf o svcutil problem?


No comments:

Post a Comment