WSDL : Web Service Definition Language Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic
WSDL: describe a web services Initialized by IBM, Microsoft, Ariba and 6~ other companies : w3c releases WSDL 2.0
Interoperability Using WSDL Get WSDL doc Invoke Service J2EE Container Service Objects WSDL description Client Service SOAP HTTP
WSDL: Describe a web service Interface information describing all publicly available functions Data type information for all message requests and message responses Binding information about the transport protocol to be used Address information for locating the specified services
WSDL: A contract between requestor and provider Platform and language-independent Describe SOAP services Automatic tool to generate client and sever code
What do we learn? WSDL specification Generate WSDL for a service (from java objects to WSDL) Generate java classes from WSDL Other ways for distributed system: rmi, and CORBA
An example of WSDL: HelloWorld Root element, defines namespaces WSDL-SOAP binding xmlschema WSDL schema Convention, refer to itself (?) WSDL uses it to generate package name
Where is the service located? The service location: the endpoint of the SOAP message
Bind messages to operations Use SOAP HTTP protocol
- Bind messages to operations Operation: sayHello Input Message: sayHelloRequest Output Message: sayHelloResponse
Define message: sayHelloRequest Content of message Define massage: sayHelloResponse Parameter 1, type string Parameter 2, type string Parameter 1, type string
Structure of WSDL P121 fig 6-1 : Root WSDL Element :What data types will be transmitted? :What message will be transmitted? :What operations (functions) will be supported? :How will the messages be transmitted on the wire? What SOAP-specific details are there? :Where is the service located?
Definition: Root element Name of the web service Declare multiple namespaces
Complex data types: Not used if limit to XML schema Define complex types (correspondent to a class in java)
Message definitions: A request message or a response message Name of the message Element defines the data types used in the message Types of the parameters for the request message Types of the return values for the response message
Operation definitions: Operations: the remote methods Input/output messages for operations -
Operation patterns supported by WSDL 1.1 P126. fig 6-3 Client One-way Request-response Client Solicit-response Notification Service Service
Basic patterns of operation One-way: –The service receives a message. –The operation therefore has a single input element Request-response: –The service receives a message and sends a response –One input element, one output element
Basic patterns of operation (2) Solicit-response –The service sends a message and receives a response –The operation has one output message, followed by one input message Notification –The service sends a message. –The operation has one output message
Transmission protocols: Binding transmission protocols to operations Axis: http
Service location: SOAP endpoint of the web service
Second example: WSDL of StockQuote Deploy the sample StockQuoteService The WSDL is at delayed-quotes?wsdl
Messages
Operations -
Binding - -
Service location -
WSDL Summary : The StockQuoteService : 1)getQuoteRequest: parameter:symbol; type: string 2)getQuoteResponse: return float :getQuote operation that consists of a request/response service :Direction to use the SOAP HTTP transport protocol. :Service available at: localhost:8080/axis/services/urn:xmltoday-delayed- quotes
Using WSDL with Axis Obtaining WSDL for deployed services WSDL2Java: Building stubs, skeletons, and data Java2WSDL: Building WSDL from Java
Obtain WSDL for deployed services Axis generates WSDL for any deployed services In the service list, check the WSDL files