Welcome to WebmasterWorld Guest from

Forum Moderators: httpwebwitch

Message Too Old, No Replies

What is the correct parse of this request?

Seems gSOAP is not handling mandatory enumeration elements properly(?)

4:09 pm on Mar 19, 2009 (gmt 0)

New User

5+ Year Member

joined:Mar 19, 2009
posts: 1
votes: 0


I have implemented a very simple SOAP server using gSOAP. I use a xsd containing among other things a declaration as below:

<xs:complexType name="Information">
<xs:element name="Type" type="tt:DynamicType"/>
<xs:element name="Name" type="tt:Name" minOccurs="0"/>
<xs:element name="Age" type="tt:Age" minOccurs="0"/>
<xs:simpleType name="DynamicType">
<xs:restriction base="xs:string">
<xs:enumeration value="Male"/>
<xs:enumeration value="Female"/>

What surprises me is that if I send a request to this server and that request contains an Information element and I leave out the Type element, this element is set to 0 (that is the same as Male) by gSOAP before my server function is called.

This is what a request might look like:


Why isn't this request rejected? Type is mandatory given the schema above.


8:13 pm on Apr 20, 2009 (gmt 0)

Moderator This Forum from CA 

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 29, 2003
votes: 0

Hi Sune, welcome to WebmasterWorld!

I guess the underlying question is: are requests being validated using the schema at all? Try putting some garbage nodes in the request, and see if you still get no errors. It could be that your XSD is there, but nothing is actually enforced.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members