By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,225 Members | 2,187 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,225 IT Pros & Developers. It's quick & easy.

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

P: 2
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
Share this Question
Share on Google+
1 Reply


P: 2
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.