SOAP

Expressing Type

  1. Use the xsi:type attribute on each accessor and reference the appropriate XML Schema type:
    <s:Envelope 
      xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" 
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <s:Body>
        <ns1:doSearch>
          <param xsi:type="xsd:string">hello</param>
        </ns1:doSearch>
      </s:Body>
    </s:Envelope>
    
  2. Reference an XML Schema document that defines the data type.
    <s:Envelope 
      xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" 
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <s:Body>
        <ns1:doSearch 
          xmlns="myschema.xsd">
          <param>hello</param>
        </ns1:doSearch>
      </s:Body>
    </s:Envelope>
    
  3. Reference some other type of schema document that defines the data type of schema document that defines the data type of element within its definition.
    <s:Envelope 
      xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" >
      <s:Body>
        <ns1:doSearch 
          xmlns="urn:some_namespace">
          <param>hello</param>
        </ns1:doSearch>
      </s:Body>
    </s:Envelope>
    <!--Where urn:some_namespace indicates some namespace-->
    <!-- where the value of param elements are strings.-->

José M. Vidal .

16 of 29