html5-img
1 / 66

E203 Developing Web Services with EAServer v4.1

Ian Thain Senior Architect eBD ithain@sybase.com. E203 Developing Web Services with EAServer v4.1. Agenda. Web services 101 Developing and Deploying Web services with WST Web Services Toolkit Demo Web Services Toolkit Interoperability Web Services Toolkit Futures Questions.

nemo
Télécharger la présentation

E203 Developing Web Services with EAServer v4.1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ian Thain Senior Architect eBD ithain@sybase.com E203Developing Web Serviceswith EAServer v4.1

  2. Agenda • Web services 101 • Developing and Deploying Web services with WST • Web Services Toolkit Demo • Web Services Toolkit Interoperability • Web Services Toolkit Futures • Questions

  3. Web services 101 • What do we have today ? • What are Web services ? • Web services benefits • High-level architecture • Protocols involved – Web services stack

  4. Web services 101 • What do we have today ? • We have components residing in app servers behind firewalls, most of which cannot be accessed via http but IIOP • So integration is hard work ! • There is no central registry of everyone's components • Limited client access

  5. Web services 101 • What are Web services ? • Made up of standards that describe business processes • Self describing • Searchable in a registry of services • Sync or Async • Loosely coupled and cross platform • Reusable

  6. Web services 101 • Web services benefits • RAD • Neutral • Architecture & language • Leverage current investment • Accessed through many different client types

  7. Registry Provider Service Web services 101 High Level Architecture • Provider creates and publishes service • A client searches a registry for that service • The client is able to connect and call the service Client

  8. Web services 101 • Protocols involved – Web Services Stack WSFL UDDI WSDL SOAP XML TCP/IP, HTTP etc Emerging Layers Core Layers

  9. Web services 101 • TCP/IP, HTTP • Common Internet Transport Protocols • Web services not tied to any one protocol

  10. Web services 101 • XML • Extensible Markup Language • Widely accepted format to exchange data & semantics • Core building block for every layer in the Web services stack

  11. Web services 101 • SOAP • Simple Object Access Protocol, • Represents a • light-weight, • wire-level protocol • for messaging & RPC communications • Based on XML

  12. Web services 101 • SOAP Message • Envelope comprised of • Header • Body • Body comprised of • Requests • Responses • Status • Attachments Envelope Header Body Requests Response Status Attachments

  13. Web services 101 • WSDL • Web Services Definition Language • Based on XML • Defines • Functionality of a Web service • Supported protocols • Message formats • Location of Web service

  14. Web services 101 Document • WSDL Document • Comprised of • Data types • Message/method • Port • Binding • Service Data Types Message Interface Port Binding Implementation Service

  15. Web services 101 • UDDI • Universal Description, Discovery and Integration • SOAP-based Web service • Allows • Providers to register services • Clients to lookup services • Uses WSDL to describe services

  16. Web services 101 Client UDDI Provider Lookup WEB Register Service

  17. Web services 101 • WSFL • Web Services Flow Language • Least developed • Hopes to define a framework that describes business logic to assemble various Web services into an end to end process.

  18. Developing and Deploying Web services • Are Web services more than just hype ? • What is Sybase doing ? • Web Services Toolkit

  19. Developing and Deploying Web services • Are Web services more than just hype ? • Service-oriented application development is real and Web services is more than just hype. • Many businesses today are designing their next generation strategic computing platforms around the idea of easily-accessible Web services • Many have begun to implement Web services, in preparation to extend their systems to this new agile computing paradigm.

  20. Developing and Deploying Web services with WST • What is Sybase doing ? • Sybase has recognized that the first step in this process is to have an inventory of available Web services. • EAServer 4.1 includes the Web Services Toolkit • WST is a utility that allows users to take their existing business components and make them available as a Web services. • The Web Services Toolkit provides support for the latest standards: SOAP, WSDL and UDDI.

  21. Developing and Deploying Web services with WST • Web Services Toolkit • The Toolkit provides a full SOAP engine, supporting SOAP request/response. • In addition, the toolkit offers a utility that can be run against a component in EAServer, to determine its “soapability”. • The utility scans the component, chooses any methods that meet the soap criteria (all in/out parameters are supported by the SOAP standard)

  22. Developing and Deploying Web services with WST • WST Generates the WSDL document that describes that method. • Once the WSDL is generated, it can be posted to a UDDI repository, making the Web service publicly available.

  23. Developing and Deploying Web services with WST • In addition, the Toolkit provides a client proxy, which can be sent along with the WSDL document to a partner organization.

  24. Developing and Deploying Web services with WST EAS Components Client Application WEB WEB Client Proxy SOAP Component WSDL Listener X WS UDDI HOST Manager • Gen WSDL, Proxy WS • Register User - Defined Types GUI

  25. Developing and Deploying Web services with WST • SOAP Listener (Servlet) • Receives a SOAP request • Verifies a valid SOAP format • Parses the SOAP request • Constructs a call to the specific component/method • Uses the output from the method • Construct a response message • Sends message back to client • Through HTTP or HTTPS

  26. Developing and Deploying Web services with WST WST GUI • Integrated into Jaguar Manager • Management of WSDL docs UDDI entries SOAP management facilities

  27. Developing and Deploying Web services with WST • Client Proxy • Provides clients of EAServer owners easy access to EAServer components: • parses WSDL file for Web service information; • builds SOAP request from WSDL info; • sends SOAP request to EAServer; • processes SOAP response; • hands output and return values to client application.

  28. Developing and Deploying Web services with WST • Client Proxy • A java developer can make java calls directly to the client proxy • The client proxy will then handle reading the WSDL and trading SOAP messages with the EAServer hosting the Web service itself. • This means that a Java developer can utilize Web services without needing any knowledge of SOAP internals.

  29. Developing and Deploying Web services with WST • Client Proxy Inter-Operability • Reads any well-formed WSDL document. • Prepares SOAP Requests for Sybase SOAP Server only. • Why: Parses method signature information from SOAPAction rather from WSDL Message and Parts elements.

  30. Developing and Deploying Web services with WST Book Supplier • SOAP Node: • processes incoming SOAP request messages; • looks up and invokes EAServer component; • builds outgoing SOAP response messages. Client Application EAServer BuyBooks() SOAP Node WEB Client Proxy X WSDL Book Supplier WebSphere BuyBooks() SOAP Node

  31. Web services Toolkit Demo • Overview • Creating WDSL • Data Types • Creating Client Proxy • Client Proxy code

  32. Web services Toolkit Demo EAS • Server-side Component: • returns the latest myPortfolio share prices Components Client Proxy WSDL WEB WEB SOAP PFShareList Listener Portfolio Cache

  33. Web services Toolkit Demo • Client-side GUI (incorporates Client Proxy): • retrieves service information from WSDL file; • builds SOAP request; • sends SOAP request via HTTP or HTTPS; • parse SOAP response message and displays returned information to user.

  34. Web services Toolkit Demo • Create a WSDL Document • Definition name • Target Namespace

  35. Web services Toolkit Demo • WSDL describes the • interface, • implementation • and deployment details • of Web services, in a uniform way. • WST separates WSDL service definitions into an interface file and an implementation file

  36. Web services Toolkit DemoInterface file <?xml version="1.0" encoding="UTF-8" ?> <wsdl:definitions name="PFTest" targetNamespace="http://ithain-2k:8080/PFTest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tnsa="http://ithain-2k:8080/PFTest"> <wsdl:types> <schema targetNamespace="http://ithain-2k:8080/PFTest" xmlns="http://www.w3.org/1999/XMLSchema"> <complexType name="ArrayOfString"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/> </restriction> </complexContent> </complexType> </schema> </wsdl:types> <wsdl:message name="getPFShareListOutput"> <wsdl:part name="return" type="tnsa:ArrayOfString"/> </wsdl:message> <wsdl:message name="getPFShareListInput"> </wsdl:message> <wsdl:portType name="PFShareListAll/PFShareListServicePortType"> <wsdl:operation name="getPFShareList"> <wsdl:input name="Input" message="getPFShareListInput"/> <wsdl:output name="Output" message="getPFShareListOutput"/> </wsdl:operation> </wsdl:portType> </wsdl:definitions> Interface file contains an abstract definition of the Web Service’s interfaces . This includes Types, Message, Ports, PortTypes and PortTypeOperations.

  37. Web services Toolkit DemoImplementation file <?xml version="1.0" encoding="UTF-8" ?> <wsdl:definitions name="PFTest" targetNamespace="http://ithain-2k:8080/PFTestImpl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tnsi="http://ithain-2k:8080/PFTestImpl" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tnsa="http://ithain-2k:8080/PFTest"> <wsdl:documentation></wsdl:documentation> <wsdl:import namespace="http://ithain-2k:8080/PFTest" location="http://ithain-2k:8080/PFTest.wsdl"/> <wsdl:binding name="PFShareListAll/PFShareListServiceBinding" type="tnsa:PFShareListAll/PFShareListServicePortType"> <soap:binding transport="http://schemas.xmlsoap/org/soap/http" style="rpc"/> <wsdl:operation name="getPFShareList"> <wsdl:input name="getPFShareListInput"> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/> </wsdl:input> <wsdl:output name="getPFShareListOutput"> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/> </wsdl:output> <soap:operation soapAction="PFShareListAll/PFShareList.getPFShareList return,java.lang.String[],return" style="rpc"/> </wsdl:operation> </wsdl:binding> <wsdl:service name="PFShareListAll/PFShareListService"> <wsdl:documentation></wsdl:documentation> <wsdl:port name="PFShareListAll/PFShareListServicePort" binding="tnsi:PFShareListAll/PFShareListServiceBinding"> <soap:address location="http://ithain-2k:8080/WEBSERVICES/SOAP"/> </wsdl:port> </wsdl:service> </wsdl:definitions> soap:binding provides association between the abstract entity and a protocol. wsdl:port provides the access point to the service (the SOAP Servlet) Contains the definitions of a Web Service instance by a specific provider. This includes Service, Port, Binding and Binding Elements

  38. Web services Toolkit Demo • Create a new Web service in the WSDL Document • Browse packages and components • These are components that use supported data types.

  39. WST Supported Data types • From WST you can select any installed component in EAServer that uses supported data types as • return values and • parameters. • Overloaded methods are supported • There are two component types for Java components • Java with IDL • Java with JDBC data types

  40. Java primitive datatypes java.lang object datatypes org.omg CORBA holder datatypes boolean java.lang.Boolean org.omg.CORBA.BooleanHolder byte java.lang.Byte org.omg.CORBA.ByteHolder double java.lang.Double org.omg.CORBA.DoubleHolder float java.lang.Float org.omg.CORBA.FloatHolder int java.lang.Int org.omg.CORBA.IntHolder long java.lang.Long org.omg.CORBA.LongHolder short java.lang.Short org.omg.CORBA.ShortHolder string java.lang.String org.omg.CORBA.StringHolder WST Supported Data types

  41. WST Supported Data types • EAServer supported data types are: • BCD.BinaryHolder • BCD.Decimal • BCD.DecimalHolder • BCD.Money • BCD.MoneyHolder • MJD.Date • MJD.Time • MJD.Timestamp

  42. WST Supported Data types • WST supports arrays of known data types encoded as SOAP arrays by data type, including support of arrays of any type. • It also supports java.util.Vector • elements must be a known data type • JavaBeans are not automatically supported

  43. User Defined Data types • The simplest case to explain is that of an object that follows the JavaBean design pattern. • In this case we can use the BeanSerializer provided as part of WST. • com.sybase.webservices.soap.encoding.BeanSerializer • This is rather than having to write your own serializer for the type, but the notion is exactly the same.

  44. User Defined Data types package com.sybase.sample; public class SimpleBean implements java.io.Serializable { public SimpleBean( ) { } public void setValue( String value ) { this.value = value; } public String getValue( ) { return this.value; } private String value = null; } zero argument constructor Get and set for each field Get and set for each field

  45. User Defined Data types Then in the WST GUI we define the type and make an association with the serializer/deserializer that we want to operate on the object • In the Manage SOAP User- Defined Types window under the SOAP Management/Utilities folder. Once this type is saved then if a component uses this data type it will show up in the WST GUI as an available component (after a server refresh/restart).

  46. Web services Toolkit Demo • Open the Web services properties • Web services Address • Service Operation

  47. Web services Toolkit Demo Expand the SOAP Management section and take the option to Create a SOAP ClientProxy JAR

  48. Web services Toolkit Demo Specify a Proxy JAR filename, and select the Implementation file to be used

  49. Web services Toolkit Demo

  50. Web services Toolkit Demo Create a Java Application

More Related