Sams Teach Yourself Java™ in 24 Hours (Covering Java 7 and Android)

(singke) #1
ptg7068951

Using Web Service Definition Language Files 319

You don’t have to understand WSDLto create JAX-WS services and clients
to access those services. It’s worthwhile to take a cursory look at the con-
tents to get a picture for how SOAP- and REST-based web services operate.


LISTING 22.4 A Web Service Description Language Contract
1: <?xml version=”1.0” encoding=”UTF-8”?>
2: <!— Published by JAX-WS RI at http://jax-ws.dev.java.net. RI’s version
3: is JAX-WS RI 2.2.2 in JDK 7. —>
4: <!— Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI’s version
5: is JAX-WS RI 2.2.2 in JDK 7. —>
6: <definitionsxmlns:soap=”http://schemas.xmlsoap.org/wsdl/soap/
7: xmlns:tns=”http://ws.java24hours.com/
8: xmlns:xsd=”http://www.w3.org/2001/XMLSchema
9: xmlns=”http://schemas.xmlsoap.org/wsdl/
10: targetNamespace=”http://ws.java24hours.com/
11: name=”SquareRootServerImplService”>
12:
13: <messagename=”getSquareRoot”>
14: <partname=”arg0”type=”xsd:double”>
15:
16:<messagename=”getSquareRootResponse”>
17: <partname=”return”type=”xsd:double”>
18:
19: <messagename=”getTime”>
20: <messagename=”getTimeResponse”>
21: <partname=”return”type=”xsd:string”>
22:
23: <portTypename=”SquareRootServer”>
24: <operationname=”getSquareRoot”parameterOrder=”arg0”>
25: <inputmessage=”tns:getSquareRoot”>
26:<outputmessage=”tns:getSquareRootResponse”>
27:
28: <operationname=”getTime”parameterOrder=””>
29: <inputmessage=”tns:getTime”>
30: <outputmessage=”tns:getTimeResponse”>
31:
32:
33: <bindingname=”SquareRootServerImplPortBinding”
34: type=”tns:SquareRootServer”>
35: <soap:bindingtransport=”http://schemas.xmlsoap.org/soap/http
36: style=”rpc”></soap:binding>
37: <operationname=”getSquareRoot”>
38: </soap:operation>
39:
40: <soap:bodyuse=”literal”
41: namespace=”http://ws.java24hours.com/”></soap:body>
42:
43:
44: <soap:bodyuse=”literal”
45: namespace=”http://ws.java24hours.com/”></soap:body>
46:

Free download pdf