Download presentation
Presentation is loading. Please wait.
1
IBM Labs in Haifa J2EE Technologies: Web Services II Benny Rochwerger Research Staff Member
2
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 2 Agenda Web Services: What is it about XML Primer Simple Object Access Protocol – SOAP Describing Web Services – WSDL Discovering Web Services – UDDI Web Services in the Marketplace What is next The Open Grid Services Architecture
3
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 3 The Service Oriented Architecture (SOA) Service Provider Service Registry Service Requestor Publish Bind Find
4
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 4 The Web Services Stack Service Publication/Discovery Service Description XML Messaging Transport Network UDDI WSDL SOAP HTTP, SMTP, MQSeries, etc.
5
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 5 Web Services Description Language (WSDL) Why service descriptions are needed ? SOAP is the format of the envelope It does not specify what message goes into the envelope A formal mechanism to describe What goes into the body What messaging protocol to use What address to send the message to
6
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 6 Web Services Description Language (WSDL) Application level service description (abstract interface) What a service does Operations, parameters, return values Protocol-specific details needed to access the service end points (concrete binding information) How a service is accessed Data formats and protocols necessary Where a service is located Network address of service provider
7
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 7 WSDL Elements WHAT portType An abstract interface definition Consist of operation elements Abstract method signature message Set of parameters referred to by method signatures It is decomposed into part elements type The collection of all the data types used in the Web Service
8
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 8 WSDL Elements (cont.) HOW binding Details of how elements in abstract interface are to be converted into a concrete representation Data formats Network protocols WHERE port How a binding is deployed at a particular network endpoint service A named collection of ports
9
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 9 The portType Element............
10
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 10 The operation Element Request-response style of operation input, output and zero or more faults Most common style Maps nicely to HTTP <fault message="StockAvailableRegistrationError" name="StockAvailableNotificationErrorMessage"/> <fault message="StockAvailableExpirationError" name="StockAvailableExpirationError"/>
11
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 11 The operation Element (cont.) One-way style of operation input message only Useful to change state of service provider HTTP response is an acknolegment of the message with no application level semantics
12
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 12 The operation Element (cont.) Notification style of operation output message only Asynchronous one-way push from service provider Useful for notifying state information back to requestor
13
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 13 The operation Element (cont.) Solicit-response style of operation output, input and zero or more faults Initiated by service provider as in the notification style Response is expected from service requestor <fault name=“RequestorIDNotAvailableError” message=“RequestorIDNotAvailableErrorMessage”>
14
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 14 The message and part Elements A message A named collection of parts Can be used as input, output or fault within an operation A part A tuple Use simple types directly or complex types defined in the types element Types are a complexType or an element
15
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 15 From Java to WSDL … public class StockQuoteService { public float getQuote (String symbol) throws Exception { return com.ibm.wstk.util.Quote.getQuote( symbol ); }
16
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 16 The binding Element How to format messages How WSDL relates to SOAP headers, bodies, encoding, etc. The binding element tells service requestor how to format messages in a protocol-specific manner Each portType can have more than one binding associated
17
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 17 The binding Element <binding name="StockAvailableNotificationSOAPBinding" type="StockAvailableNotificationPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <soap:operation soapAction= http://www.skatesTown.com/StockAvailableNotification/registration/> <soap:header message="StockAvailableRegistrationRequest" part="expiration" use="encoded“ namespace="http://www.skatestown.com/ns/registrationRequest“ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
18
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 18 <binding name="StockAvailableNotificationSOAPBinding" type="StockAvailableNotificationPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <soap:operation soapAction= http://www.skatesTown.com/StockAvailableNotification/registration/> <soap:header message="StockAvailableRegistrationRequest" part="expiration" use="encoded“ namespace="http://www.skatestown.com/ns/registrationRequest“ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> Unique name The binding Element The type attribute is used to identify portType Use SOAP messaging RPC or document SOAP/HTTP Set the soapAction HTTP header. Can be used as a routing hint Put the “expiration” part of the message into the SOAP header Encode data, i.e., serialize/deserialize Put the “registration” part of the message into the SOAP body Do not encode data, i.e., pass XML to/from application
19
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 19 The binding Element (cont.) <soap:body use="encoded" namespace="http://www.skatestown.com/ns/registrationRequest" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> <soap:fault name="StockAvailableNotificationErrorMessage" namespace="http://www.skatestown.com/ns/registrationRequest" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
20
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 20 The service and port Elements service Container of port elements port Identify network address of endpoint <port name="StockAvailableNotificationPort“ binding="StockAvailableNotificationSOAPBinding">
21
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 21 Using WSDL Service client development Input to proxy generator which produces client code Service invocation Input to dynamic invocation proxy which generates, at run time, correct service requests
22
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 22 Application SOAP Engine Network Protocol Service Requestor Service Invocation Web Service SOAP Engine Network Protocol Service Provider Y Web Service SOAP Engine SMTP Service Provider X HTTP
23
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 23 Application SOAP Engine Network Protocol Service Requestor Service Invocation Web Service SOAP Engine HTTP Service Provider Y Web Service SOAP Engine SMTP Service Provider X SMTP
24
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 24 WSDL Summary Elements to define abstract interface of a service What a service does Elements to specify concrete binding information How a service is accessed Where a service is located
25
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 25 UDDI – Universal Description, Discovery and Integration XML-based mechanism to build centralized registry of services Facilitate service discovery both at design time and dynamically at runtime UDDI is a: Business Registry Public online business/services registry Available since 2001 Consists of replicas hosted at UDDI Operators Currently there are two: IBM and Microsoft Operators should be indistinguishable Set of APIs and data structures Enable programmatically registration and inquiry of services
26
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 26 The UDDI Data Structures The businessEntity data structure White pages Name, address and contact information Yellow pages Classification information about the types and location of the services the entity offers Green pages Technical data, e.g., how to invoke the offered services The tModel data structure An abstract technology model that is used to represent the reusable definition of a service (the interface) The bindingTemplate data structure Holds the technical information for the service to actually be invoked
27
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 27 The UDDI APIs A set of Create, Read, Update and Delete (CRUD) operations BusinessServiceBindingtModel Save/Updatesave_businesssave_servicesave_bindingsave_tModel Deletedelete_businessdelete_servicedelete_bindingdelete_tModel Findfind_businessfind_servicefind_bindingfind_tModel GetDetail get_businessDetailget_serviceDetailget_bindingDetailget_tModelDetail
28
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 28 UDDI Pointers The UDDI initiative http://www.uddi.org IBM http://www.ibm.com/services/uddi Microsoft http://uddi.microsoft.com
29
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 29 The Web Services Landscape (partial) The J2EE world BEA – WebLogic Server http://www.bea.com/products/weblogic/server Iona – XMLBus http://www.xmlbus.com/ Macromedia – JRun http://www.macromedia.com/software/jrun Sun – Sun ONE Application Server http://wwws.sun.com/software/products/appsrvr/home_appsrvr.html IBM – WebSphere http://www.ibm.com/websphere
30
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 30 The Web Services Landscape (partial) .NET Microsoft’s platform for distributed computing Common Language Runtime (CLR) Similar to Java’s virtual machine bytecode generated from C#, C++, Visual Basic, COBOL Core classes Similar to Java class library ASP.NET A programming framework built on CLR that can be used on a server to build Web applications Equivalent to J2EE container ?
31
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 31 The Web Services Landscape (partial) Other languages and environments SOAP::Lite Perl interface to the SOAP. Both client and server http://www.soaplite.com/ SOAPPy Python interface to the SOAP. Both client and server http://sourceforge.net/projects/pywebsvcs eSOAP A C++ library that provides a SOAP engine for embeddeding systems Available on RTEMS, eCos, QNX Microsoft Windows - NT/2000/98/ME Linux http://www.embedding.net/eSOAP
32
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 32 The Apache eXtensible Interaction System (AXIS) A very flexible SOAP engine from Apache Open and pluggable architecture Design to cope with various deployment configuration From very simplistic to highly sophisticated configurations The Java Web Services facility (JWS) Drop-in development Simplest and quickest way to deploy a Java-base Web Service Rename source file from xxx.java to xxx.jws Drop xxx.jws into JWS directory
33
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 33 Axis Components Axis Engine Main entry point into message processing model Coordinate message flow Handlers Message processing logic Chains Ordered collections of handlers (invoked sequentially) Pre/post processing of messages is achieved by defining chains Dispatcher (the pivot handler) The bridge between Axis and the business logic (i.e., the Web Service) The RPCDispatcher SOAP body to/from Java objects Location and Invocation of code
34
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 34 Axis Components (cont.) Transport Listeners Deal protocol specific encapsulation Responsible for Axis Engine instantiation The AxisServlet A transport listener for HTTP Deployment/Configuration Add/remove Web Services to Axis Creation of service specific chains Configuration of transport and global chains Serializers/Deserializers Convertion of native data types to/from XML
35
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 35 Request Handlers Response Handlers Axis on the Server Dispatcher Axis Engine Axis Engine Transport Request Chain Global Request Chain Transport Response Chain Global Response Chain TL Transport Requestor TL Transport Requestor Web Service Web Service Web Service specific chain
36
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 36 Axis on the Client Transport Application Transport Sender Transport Sender Axis Engine Axis Engine Transport Request Chain Global Request Chain Transport Response Chain Global Response Chain Web Service specific request handlers Web Service specific response handlers
37
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 37 What is missing in the Web Services Model ? getQuote(“BMW”) Stock Quotes Provider BMW (ISE:BMW) Time: 7:11 Last Price: 1961.00 Change: +18.00 Open: 1942.00 High: 1977.00 @ 5:41 ET Low: 1927.00 @ 3:16 ET Currency: GBX Used Motorcycle dealer 1. BMW K 1200 RS Mileage: 8266 Year: 1999 Price: £6950 2. BMW R 1100 S Mileage:10347 Year: 1998 Price: £5750 3. BMW R 1100 S Mileage : 7284 Year: 1999 Price: £6250 4. BMW R 1100 S Mileage: 9000 Year: 2000 Price: £6350
38
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 38 What is missing in the Web Services Model ? Service description captures interface syntax The service accepts an operation request with a particular signature Service description does not capture semantics The Open Grid Services Architecture Operation should respond as expected “As expected” is usually defined offline in specifications Use names as basis for reasoning about semantics Standardize common services and operations
39
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 39 What is Next – The Open Grid Services Architecture Standard interfaces and behaviors that address key distributed system issues: Service description & information access Notification Policy management Lifetime management Service naming Authentication Reliable invocation Transient stateful service instances
40
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 40 The OGSA Framework
41
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 41 The Grid Service: Interface/Behaviors & Service Data
42
IBM Labs in Haifa J2EE Technologies - Web Services II © 2003 IBM Corporation 42 Tools and Information Suggested reading Building Web Services with Java by Graham et.al., 2002, Sams Publishing AXIS, Next Generation Java SOAP by Irani ant Basha, 2002, Wrox Press Web Services Standards http://www.w3.org/2002/ws/ Apache’s AXIS http://xml.apache.org/axis/ IBM developerWorks : Web Services http://www.ibm.com/developerworks/webservices IBM developerWorks : WebSphere http://www7b.software.ibm.com/wsdd/ Other Web Services good sites www.webservices.org www.gotdotnet.com The OGSA Working Group http://www.gridforum.org/ogsa-wg/
43
IBM Labs in Haifa J2EE Technologies: Web Services II Benny Rochwerger Research Staff Member
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.