Given an XML schema for a document style Web service create a WSDL file that describes the service and generate a service implementation.

[Note]

Empty

Method

The wsdl:operation element corresponding to each method has one or more child elements as follows:

Each wsdl:message element has one of the following:

Each method in a Java SEI is mapped to a soap:operation child element of the corresponding wsdl:operation. The value of the style attribute of the soap:operation is document or rpc.

If not specified, the value defaults to the value of the style attribute of the soap:binding. WS-I Basic Profile requires that all operations within a given SOAP HTTP binding instance have the same binding style.

The parameters of a Java method are mapped to soap:body or soap:header child elements of the wsdl:input and wsdl:output elements for each wsdl:operation binding element. The value of the use attribute of the soap:body is literal.

Example shows using document style:


<types>
  <schema targetNamespace="...">
  
    <xsd:element name="getPrice" type="tns:getPriceType"/>
    <xsd:complexType name="getPriceType">
      <xsd:sequence>
        <xsd:element name="tickerSymbol" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="getPriceResponse" type="tns:getPriceResponseType"/>
    <xsd:complexType name="getPriceResponseType">
      <xsd:sequence>
        <xsd:element name="return" type="xsd:float"/>
      </xsd:sequence>
    </xsd:complexType>
    
  </schema>  
</types>

<message name="getPrice">
  <part name="getPrice" element="tns:getPrice"/>
</message>

<message name="getPriceResponse">
  <part name="getPriceResponse" element="tns:getPriceResponse"/>
</message>

<portType name="StockQuoteProvider">
  <operation name="getPrice" parameterOrder="tickerSymbol">
    <input message="tns:getPrice"/>
    <output message="tns:getPriceResponse"/>
  </operation>
</portType>

<binding name="StockQuoteProviderBinding">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
  <operation name="getPrice" parameterOrder="tickerSymbol">
    <soap:operation/>
    <input message="tns:getPrice">
      <soap:body use="literal"/>
    </input>
    <output message="tns:getPriceResponse">
      <soap:body use="literal"/>
    </output>
  </operation>
</binding>
		 		 		 		 		 
					

Example shows using rpc style:


<types>
  <schema targetNamespace="...">
  
    <xsd:element name="getPrice" type="tns:getPriceType"/>
    <xsd:complexType name="getPriceType">
      <xsd:sequence>
        <xsd:element form="unqualified" name="tickerSymbol" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="getPriceResponse" type="tns:getPriceResponseType"/>
    <xsd:complexType name="getPriceResponseType">
      <xsd:sequence>
        <xsd:element form="unqualified" name="return" type="xsd:float"/>
      </xsd:sequence>
    </xsd:complexType>
    
  </schema>
</types>

<message name="getPrice">
  <part name="tickerSymbol" type="xsd:string"/>
</message>

<message name="getPriceResponse">
  <part name="result" type="xsd:float"/>
</message>

<portType name="StockQuoteProvider">
  <operation name="getPrice">
    <input message="tns:getPrice"/>
    <output message="tns:getPriceResponse"/>
  </operation>
</portType>

<binding name="StockQuoteProviderBinding">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
  <operation name="getPrice">
    <soap:operation/>
    <input message="tns:getPrice">
      <soap:body use="literal"/>
    </input>
    <output message="tns:getPriceResponse">
      <soap:body use="literal"/>
    </output>
  </operation>
</binding>
		 		 		 		 		 
					

Professional hosting     Belorussian informational portal         Free SCWCD 1.4 Study Guide     Free SCDJWS 1.4 Study Guide     SCDJWS 1.4 Quiz     Free IBM Certified Associate Developer Study Guide     IBM Test 000-287. Enterprise Application Development with IBM WebSphere Studio, V5.0 Study Guide     SCDJWS 5.0 Quiz