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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mato81
    New Member
    • Feb 2008
    • 2

    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 elementFormDefa ult="qualified" targetNamespace ="http://www.home.NET">
    <s:element name="GetWeathe r">
    <s:complexTyp e>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="CityName" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="CountryNa me" type="s:string"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="GetWeathe rResponse">
    <s:complexTyp e>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="GetWeathe rResult" type="s:string"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="GetCities ByCountry">
    <s:complexTyp e>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="CountryNa me" type="s:string"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="GetCities ByCountryRespon se">
    <s:complexTyp e>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="GetCities ByCountryResult " 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!!
  • mato81
    New Member
    • Feb 2008
    • 2

    #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">s tring</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)

    Comment

    Working...