467,176 Members | 1,393 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,176 developers. It's quick & easy.

WSDL <s:element name="string" nillable="true" type="s:string"/>?

Hi all!

I am a newbie to WSDL. I have a questions which has been driving me crazy...

If I would have a WSDL with a types element somewhat like below, what is the point of the third last row "<s:element name="string" nillable="true" type="s:string"/>". Why is it there and what is it for?

...
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.home.NET">
<s:element name="GetWeather">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CityName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="CountryName" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetWeatherResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetWeatherResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetCitiesByCountry">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CountryName" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetCitiesByCountryResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetCitiesByCountryResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="string" nillable="true" type="s:string"/>
</s:schema>
</wsdl:types>


Thank you very much for any help!!
Feb 22 '08 #1
  • viewed: 11835
Share:
1 Reply
OK! Found the answer! I was to much thinking of the SOAP messages, when this is for HTTP Get and POST where is a string element.

E.g.

------------
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.home.NET">string</string>
------------


And if there is "<s:element name="string" nillable="true" type="s:string"/>" in the schema it means that "if {nillable} is true, then an element may also be ·valid· if it carries the namespace qualified attribute with [local name] nil from namespace http://www.w3.org/2001/XMLSchema-instance and value true (see xsi:nil (§2.6.2)) even if it has no text or element content despite a {content type} which would otherwise require content. Formal details of element ·validation· are described in Element Locally Valid (Element) (§3.3.4)." (W3C XML Schema Part 1: Structures Second Edition)
Feb 23 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by matatu | last post: by
reply views Thread by John Jenkins | last post: by
reply views Thread by John Jenkins | last post: by
reply views Thread by John Jenkins | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.