Presentation is loading. Please wait.

Presentation is loading. Please wait.

Grid Computing, B. Wilkinson, 20043b.1 Web Services Part II.

Similar presentations


Presentation on theme: "Grid Computing, B. Wilkinson, 20043b.1 Web Services Part II."— Presentation transcript:

1 Grid Computing, B. Wilkinson, 20043b.1 Web Services Part II

2 Grid Computing, B. Wilkinson, 20043b.2 Web Services From http://www.globus.org

3 Grid Computing, B. Wilkinson, 20043b.3 Address of a Web Service URIs Example (URL) http://www.cs.wcu.edu/webservices/math1 This does not exist, and if did, would only be meaningful to software.

4 Grid Computing, B. Wilkinson, 20043b.4 Client-Service Implementation Suppose we have found the service and have its WSDL description, i.e. got past step 4. In the implementation, it is convenient to use stubs - java classes suitable for web services defined with WSDL.

5 Grid Computing, B. Wilkinson, 20043b.5 Client Stub Between the client code and the network is a client stub, sometimes called client proxy. The client stub is responsible for taking a request from the client and converting the request into a SOAP request on the network - marshalling. Also responsible for receiving SOAP responses on network and converting to a suitable form for client.

6 Grid Computing, B. Wilkinson, 20043b.6 Server Stub Between the service and the network is a server stub, sometimes called a skeleton. Responsible for receiving a SOAP request from the client stub and converting it into a suitable form for the service -unmarshalling. Also converts the response from the service into a SOAP message for the client stub.

7 Grid Computing, B. Wilkinson, 20043b.7 Web Service Application

8 Grid Computing, B. Wilkinson, 20043b.8 Steps Client calls client stub. SOAP request sent across network Server stub receives request and sends request to service Service send result to serve stub Server stub sends result across network to client stub. Client stub sends result to client.

9 Grid Computing, B. Wilkinson, 20043b.9 Web Service Application Call client stub SOAP request Request service Result returned SOAP response Client receives result

10 Grid Computing, B. Wilkinson, 20043b.10 Web Service Description Need a way of formally describing a service, what is does, how it is accessed, etc. An Interface Description language (IDL)

11 Grid Computing, B. Wilkinson, 20043b.11 Web Service Definition Language (WSDL) A W3C standard XML document that describes three fundamental properties of a service: What it is - operations (methods) it provides. How it is accessed - data format, protocols. Where it is located - protocol specific network address.

12 Grid Computing, B. Wilkinson, 20043b.12 Elements of a WSDL document

13 Grid Computing, B. Wilkinson, 20043b.13 Parts of a WSDL Document Parts of an WSDL document:: Root definitions - namespaces portType definitions - abstract definition of service Message definitions - parameters in method signature Type definitions - data types Binding definitions - to protocols I.e. SOAP over HTTP Service definitions - where service is, ports

14 Grid Computing, B. Wilkinson, 20043b.14 portType Describes “What” - an abstract definition of service operation. Uses the elements: message definitions - a set of parameters referred to by method signature, decomposed into parts type definitions - defines all data types used

15 Grid Computing, B. Wilkinson, 20043b.15 Binding Describes “how” the elements in abstract interface (portType) are converted in actual data representations and protocols e.g. SOAP over HTTP.

16 Grid Computing, B. Wilkinson, 20043b.16 port and service Describes “where” service is. port - describes how a binding is deployed at the endpoint of a network service - a named collection of ports

17 Grid Computing, B. Wilkinson, 20043b.17 Root definitions <definitions name=“PriceCheck” targetNamespace=“http://www.skatestown.com/services/PriceCheck” xmlns:pc=“http://www.skatestown.com/services/PriceCheck” xmlns:avail=“http://www.skatestown.com/ns/availability” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:soap=“http://schemas.xmlsoap.org/wsdl/”>..

18 Grid Computing, B. Wilkinson, 20043b.18 portType definitions

19 Grid Computing, B. Wilkinson, 20043b.19 Message definitions

20 Grid Computing, B. Wilkinson, 20043b.20 Type definitions <xsd:schema targetNamespace=“http://www.skatestown.com/ns/availability” xmlns:xsd=“http://www.w3.org/23001/XMLSchema”>

21 Grid Computing, B. Wilkinson, 20043b.21 Binding definitions <soap:binding style=“rpc” transport=“http://schemas.xmlsoap.org/soap/http”/> <soap:body use=“encoded” namespace=“http://www.skatestown.com/services/PriceCheck” encodingStype=“http://schemas/xmlas.xmlsoap.org/soap/encoding?”/> <soap:body use=“encoded” namespace=“http://www.skatestpwn.com/services/PriceCheck” encodingStype=“http://schemas/xmlas.xmlsoap.org/soap/encoding?”/>

22 Grid Computing, B. Wilkinson, 20043b.22 Service definitions <soap:address location= “http://localhost:8-8-/axis/services/PriceCheck”/>

23 Grid Computing, B. Wilkinson, 20043b.23 Building a Service Preliminary to Assignment 1 To build (deploy) a service one has to create: a WSDL document for the service the client stub the server stub and test with a client.

24 Grid Computing, B. Wilkinson, 20043b.24 Java Web Service (JWS) (The easy way to deploy a service) With JWS facility, service code with jws extension in the Axis-enabled web application is interpreted a web service..jws file automatically compiled if necessary when service called. Simple and used in assignment 1 but has limitations.

25 Grid Computing, B. Wilkinson, 20043b.25 Could actually use the web service after deployment with JWS without using a WSDL file nor stubs! Just use the service URL which would have a.jws extension - need some code in client and service to make SOAP calls.

26 Grid Computing, B. Wilkinson, 20043b.26 WSDL from Code One can write the service code (as a class or interface) and then use tools to generate the WSDL document. –Axis Java2WSDL program generates WSDL file (and its scheme).

27 Grid Computing, B. Wilkinson, 20043b.27 WSDL from Running Service Another Axis tool can generate the WSDL document.directly from a running deployed service. add ?wsdl onto service URL. Example of this in assignment 1

28 Grid Computing, B. Wilkinson, 20043b.28 Stubs from WSDL If we have the WSDL document for the service, can use tools to generate client and server stubs: –Axis WSDL2Java program generates stubs for use on client and server –Example of this in assignment 1.


Download ppt "Grid Computing, B. Wilkinson, 20043b.1 Web Services Part II."

Similar presentations


Ads by Google