Relation between XmlNode and WSDL minoccurs or type

P

Patrick

I have a WSDL-file that looks like the following (Part of it)

- <s:complexType name="Persoonslijst">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Persoon"
type="s0:CAT01type" />
</s:sequence>
</s:complexType>

- <s:complexType name="CAT01type">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Geboorte"
type="s0:GR03type" />
</s:sequence>
</s:complexType>

- <s:complexType name="GR03type">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Geboortedatum"
type="s:unsignedInt" />
<s:element minOccurs="0" maxOccurs="1" name="Geboorteplaats"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Geboorteland"
type="s:integer" />
</s:sequence>
</s:complexType>

-------------------------------------------------------------------------

I have a XMLDataDocument where I have specified a node
[Geboortedatum].
As long as it has a value like

<Persoonslijst>
<Persoon>
<Geboortedatum>19800305</Geboortedatum>
</Persoon>
</Persoonslijst

Deserialization works fine.

But when the <Geboortedatum> is empty like <Geboortedatum />,
deserialization fails.

Question...

In my first WSDL the value of minoccurs of Geboortedatum was set to 1
In my last WSDL i set the minoccurs to 0, expecting (and hoping!) that
it was possible to leave the Geboortedatum node empty. But this fails.

I'm expecting now that because the type = unsignedInt, it validates
the value I'm want to deserialize against this type. And a value of
empty is not valid.
(We I change the type from unsignedInt to string, there is no problem)

So can anyone please tell me what the true story is.

Kind regards Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top