![]() | |
| |
Empty
Method
The wsdl:operation element corresponding to each method has one or more child elements as follows:
A wsdl:input element that refers to an associated wsdl:message element to describe the operation input.
(Two-way methods only) an optional wsdl:output element that refers to a wsdl:message to describe the operation output.
(Two-way methods only) zero or more wsdl:fault child elements, one for each exception thrown by the method. The wsdl:fault child elements refer to associated wsdl:message elements to describe each fault.
Each wsdl:message element has one of the following:
Document style
A single wsdl:part child element that refers, via an element attribute, to a global element declaration in the wsdl:types section:
@WebService
public interface StockQuoteProvider {
float getPrice(String tickerSymbol) throws TickerException;
}
<types>
<xsd:schema targetNamespace="...">
<!-- element declarations -->
<xsd:element name="getPrice" type="tns:getPriceType"/>
<xsd:element name="getPriceResponse" type="tns:getPriceResponseType"/>
<xsd:element name="TickerException" type="tns:TickerExceptionType"/>
<!-- type definitions -->
...
</xsd:schema>
</types>
<message name="getPrice">
<part name="getPrice" element="tns:getPrice"/>
</message>
<message name="getPriceResponse">
<part name="getPriceResponse" element="tns:getPriceResponse"/>
</message>
<message name="TickerException">
<part name="TickerException" element="tns:TickerException"/>
</message>
<portType name="StockQuoteProvider">
<operation name="getPrice">
<input message="tns:getPrice"/>
<output message="tns:getPriceResponse"/>
<fault message="tns:TickerException"/>
</operation>
</portType>
RPC style
Zero or more wsdl:part child elements (one per method parameter and one for a non-void return value) that refer, via a type attribute, to named type declarations in the wsdl:types section:
@WebService
public interface StockQuoteProvider {
float getPrice(String tickerSymbol) throws TickerException;
}
<types>
<xsd:schema targetNamespace="...">
<!-- element declarations -->
<xsd:element name="TickerException" type="tns:TickerExceptionType"/>
<!-- type definitions -->
...
</xsd:schema>
</types>
<message name="getPrice">
<part name="tickerSymbol" type="xsd:string"/>
</message>
<message name="getPriceResponse">
<part name="return" type="xsd:float"/>
</message>
<message name="TickerException">
<part name="TickerException" element="tns:TickerException"/>
</message>
<portType name="StockQuoteProvider">
<operation name="getPrice">
<input message="tns:getPrice"/>
<output message="tns:getPriceResponse"/>
<fault message="tns:TickerException"/>
</operation>
</portType>
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>
|
|
|
|
Hosting provided by PerfoHost: KVM VPS. Unix VPS. Windows VPS. VPN. Domains. Dedicated servers. Colocation.