Java 2EE and XML Development

Скачать в pdf «Java 2EE and XML Development»


Listing 4.9 WSDL for the product pricing web services


<?xml version=»1.0″?>


<definitions


targetNamespace=»java:examples.chapter4.webservices.rpc


xmlns:tns=»java:examples.chapter4.webservices.rpc»


xmlns=»http://schemas.xmlsoap.org/wsdl/«


xmlns:xsi=»http://www.w3.org/1999/XMLSchema-instance«


xmlns:xsd=»http://www.w3.org/1999/XMLSchema«


xmlns:soap=»http://schemas.xmlsoap.org/wsdl/soap/«


>


<types>


<schema


targetNamespace=’java:examples.chapter4.webservices.rpc’


xmlns=’http://www.w3.org/1999/XMLSchema’>


<!— Derived XML data types would go here —>


</schema>


</types>


<!—


Inbound/Outbound message definitions for our RPC service —>


<message name=»getProductPriceRequest»>


<part name=»productId» type=»xsd:string» />


</message>


<message name=»getProductPriceResponse»>


<part name=»return» type=»xsd:double» />


</message>


<!—


The definition of the web service port type.


This binds the messages above together into an RPC request/response «operation.»


—>


<portType name=»ProductPricingPortType»>


<operation name=»getProductPrice»>


<input message=»tns:getProductPriceRequest»/>


<output message=»tns:getProductPriceResponse»/>


</operation>


</portType>


<!—


A binding of our new port type to SOAP/HTTP.


—>


<binding


name=»ProductPricingBinding»


type=»tns:ProductPricingPortType»>


<soap:binding style=»rpc»


transport=»http://schemas.xmlsoap.org/soap/http/»/>


<operation name=»getProductPrice»>


<soap:operation soapAction=»urn:getProductPrice»/>


<input>


<soap:body use=»encoded» namespace=’urn:ProductPricing’


encodingStyle=»http://schemas.xmlsoap.org/soap/encoding/»/>


</input>


<output>


<soap:body use=»encoded» namespace=’urn:ProductPricing’


encodingStyle=»http://schemas.xmlsoap.org/soap/encoding/»/>


</output>


</operation>


</binding>


<!—


The actual web service definition, built from the message, port, and binding information above.


This is where the actual URL for the service is specified.


<service name=»ProductPricing»>


<documentation>


This service accepts a product ID from our catalog and returns its current list price.


</documentation>


<port name=»ProductPricingPort» binding=»tns:ProductPricingBinding»> <soap:address


location=»http://localhost:7001/productPricing/productPricingURI»/>


</port>


</service>


</definitions>


Binding Information <binding> elements


Port Type Information <portType> elements

Скачать в pdf «Java 2EE and XML Development»