Download presentation
Presentation is loading. Please wait.
Published byThomas Parker Modified over 9 years ago
1
Session I Part II: WS Standards Umesh Bellur IIT Bombay umesh[at]it.iitb.ac.in
2
Session II: Contents XML Basics WS Core Standards: –WSDL –SOAP –UDDI
3
Basic SOAP Message Exchange Consuming Program Service Requestor Exposing Program Service Provider http transport SOAP message WSDL describing service Service Registry UDDI discover services WSDLs describing services SOAP message http transport
4
SOAP Message
5
Sample SOAP Message 1 2001-06-22T14:00:00-05:00 Pick up Mary at school at 2pm
6
Conversational Message Exchange buyer seller message broker RFQ QuoteResponse Award
7
Conversational SOAP Message Exchange: A Request 101 http://bigco.example.org/RFQ 17 http://bigco.example.org/RFQ SanDisk SecureDigital memory 1GB 100
8
Conversational Exchange: A Response http://bigco.example.org/RFQ env:mustUnderstand=“true”>101 2470 1 17 http://bigco.example.org/RFQ KingMax SecureDigital memory 1GB 9000KB/s Memories Unlimited KM-SD1000 100
9
Conversational Exchange: Completion 2470 1 17 http://bigco.example.org/RFQ KM-SD1000 50
10
Remote Procedure Calls To invoke RPC –Address of target SOAP node –Method name –Identities and values of arguments –Separation of arguments identifying target of RPC versus data Plus values of properties for binding (e.g. GET, POST) –Optional header data
11
RPC Invocation 5 http://shippingservice.org/transactionhttp://shippingservice.org/encod ing
12
Body http://shippingservice.org http://bigco.example.org/RFQ 2470 17 500g
13
RPC Result 5 http://shippingservice.org/transactionhttp://paymentservice.org/encoding <s:shipOrderResponse env:encodingStyle=“http://www.w3.org/2003/05/soap-encoding”http://www.w3.org/2003/05/soap-encoding xmlns:rpc=“http://www.w3.org/2003/05/soap-rpc” xmlns:s=“http://shippingservice.org”>http://shippingservice.org s:status confirmed $20.00
14
SOAP Faults Place faults inside env:Body elements In single env:Fault env:Node identifies node which generated fault –Absence indicates “ultimate recipient” env:Code –env:Value –env:Subcode env:Reason –env:Text env:Detail –Application specific
15
SOAP Fault Example env:Sender rpc:BadArguments Processing error Chyba zpracování Unknown destination 999
16
SOAP Faults on MustUnderstand env:MustUnderstand Header not understood En-tête non compris
17
SOAP Processing Model SOAP messages are sent from one sender node passing through zero or more intermediaries Three roles –next: each SOAP intermediary or end destination must act in this role –none: SOAP nodes must not act in this role –ultimateReceiver: destination acts in this role Header blocks targeted to specific roles using Role attribute If mustUnderstand=“true” SOAP receiver must understand or generate SOAP fault Header blocks processed by intermediaries are generally removed before forwarding –Override with relay attribute –Allows targeting of headers to specific intermediaries (but mustUnderstand would then generally be turned off)
18
SOAP Extensibility in Practice http://bigco.example.org/buyer dhw6weiurU982ndya73jdVBGt2567...d79HID7ghd652ad2 http://f123.com/sq14 10...
19
SOAP Processing: Header Blocks, MustUnderstand and Relay...............
20
SOAP Bindings specify how SOAP messages may be passed from one SOAP node to another using an underlying protocol provides a serialized representation of the message provides a mechanism to support features needed by SOAP applications (security, reliability, etc...) describes the features it provides
21
SOAP HTTP Binding Example POST /Reservations HTTP/1.1 Host: marketplace.example.org Content-Type: application/soap+xml; charset="utf-8" Content-Length: nnnn –
22
SOAP SMTP Binding Example From: buyer@bigco.example.orgbuyer@bigco.example.org To: rfqs@marketplace.example.org Subject: RFQ: Memory purchase Date: Thursday, September 9 2004 Message-Id: Content-Type: application/soap+xml
23
SOAP Remoting Architecture Server object implementation application level Client application code Server skeleton XML unmarshaller Client stub XML marshaller TCP/IP socket remoting architecture level wire protocol level http protocol http server http server body envelope header
24
So what’s different? Open format usable from any platform Easy to understand and debug Stable supported interfaces Standards enable “expose service once” and have multiple consumers –versus typical point to point integration efforts Easy for intermediaries to process messages and add value –Routing and delivery –security –management and monitoring –schema and service design – acceleration Easy to extend with additional semantics
25
CORBA Server object implementation application level Client application code Server skeleton Corba runtime Implementation repository Client stub Corba runtime Implementation repository ORB TCP/IP socket
26
CORBA Dynamic Invocation Server object implementation application level Client application code Server skeleton Corba runtime Implementation repository Client stub Corba runtime Implementation repository ORB TCP/IP socket binding method Remoting architecture level Wire protocol level
27
CORBA Scalability –Stateful programming model - –Shared activation + Performance –CORBA is only intermediary until object obtained (allowing direct client- server interaction) + –Binary transport + Activation –Sophisticated four policy activation methods + State Management –Provides state management with a connection-oriented protocol + Garbage Collection –Implemented on per ORB vendor basis –No concept of distributed memory management Security –Just uses SSL -
28
DCOM and DCE RPC Server object implementation application level Client application- code Server stub COM runtime Client proxy COM runtime SCM RPC channel binding method Remoting architecture level Wire protocol level registry OXID Resolver Ping client/server
29
DCOM Object Creation Server object implementation application level Client application- code Server stub COM runtime Client proxy COM runtime SCM RPC channel binding method Remoting architecture level Wire protocol level registry OXID Resolver Ping client/server
30
DCOM Object Invocation Server object implementation application level Client application- code Server stub COM runtime Client proxy COM runtime SCM RPC channel binding method Remoting architecture level Wire protocol level registry OXID Resolver Ping client/server
31
DCOM Comparison Scalability –Not scalable due to garbage collection and connection overhead –All clients involved in call required to send pings to servers at two minute intervals Performance –Many roundtrips to activate and use remote object Activation –Client obtains reference to remote object’s class object through local SCM from remote SCM –Client creates instances of remote objects through its proxy State Management –DCOM goal: location transparency –Makes it very difficult to have a stateless model User interface IFaces Iteration IFaces Garbage Collection –After three ping fails, server cleans up resources for objects owned by remote client Security –Provides authentication, authorization and identity –Many authentication methods
32
Java RMI Server object implementation application level Client application- code Server skeleton Remote Reference Layer Client stub Remote Reference Layer Transport Layer binding method remoting architecture level wire protocol level Transport Layer TCP/IP Socket RMI Registry
33
JRMP signature (JRMI) version protocol SingleOpProtocol StreamProtocol MultiplexProtocol Message (serialized arguments based On Java’s Object Serialization Protocol)
34
RMI Comparison Scalabilitiy –Good overall –Registry could be bottleneck Performance –Fairly high –Use from Java applets in browser cause conversion to http –expensive Activation –Stub can be download over the network –Lazy activation and selection of specific server instances –Allows automatic instantiation of objects based on methods faulting and the fault resolution process instantiating the remote object State Management –Provides both connection-oriented and connectionless protocols (good!) Garbage Collection –Distributed reference counting (like CORBA, DCOM) –Reference to remote objects is considered lease on object, which must be periodically renewed Security –Strong security –Must have security credentials to perform dynamic class loading
35
SOAP Comparison Scalability –Very scaleable especially over http if request/response model is maintained Performance –Degraded by XML overhead –But if you’re interoping between architectures anyway that overhead isn’t unreasonable Activation –Beyond SOAP’s scope State Management –Stateless if over http Garbage Collection –Beyond scope
36
Soap Comparison (2) Security –https/SSL - not ideal for routability of course –WS-Security Other Disadvantages –No true standard serialization method –Multiple copies of objects transported Other Advantages –Encouragement of loose coupling (both physical and interface) –Protection of apps from changes in standards –Truly vendor-agnostic
37
Web Services Description Language (WSDL)
38
Web Services Description Language Provides a model and an XML format for the “contract” of a web service Separates abstract service description from both concrete network protocol and message format Describes data types used in messages Messages are defined as aggregation of typed parts Operations are message exchange patterns supported by the web service PortTypes are named collections of operations
39
WSDL Components Types– a container for data type definitions using some type system (such as XSD). Message– an abstract, typed definition of the data being communicated. Operation– an abstract description of an action supported by the service. Port Type–an abstract set of operations supported by one or more endpoints. Binding– a concrete protocol and data format specification for a particular port type Port– a single endpoint defined as a combination of a binding and a network address. Service– a collection of related endpoints.
40
WSDL Specification types message operation porttype operation binding service port
41
An Example - WSDL Types
43
WSDL Operations
44
WSDL Bindings, Services, Ports
45
My first service
46
Import for Types
47
WSDL Binding maps the abstract service functionality to a specific network protocol and message format defines: –the communication protocol to use –how service interactions are accomplished using this protocol –the address to communicate with Three bindings are defined in the WSDL spec: –SOAP binding – HTTP binding – SMTP binding
48
WSDL Binding Example: One-way Over SMTP
49
Request-Response RPC Over HTTP – – – > My first service
50
Web Services Survey Public APIs –Google –Amazon Business APIs –SalesForce –Siebel CRM OnDemand
51
Google’s WSDL Messages
53
Google’s PortTYPE
54
Google Bindings and Endpoint <soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encodin g/" / http://api.google.com/search/beta2
55
Google Search Request XXrPsWdQFHKLrnHP5BRLENvY9mRSoAsI Java SOAP 0 10 false false
56
Search Response
57
URL xsi:type="xsd:string">http://www- 106.ibm.com/developerworks/xml/library/x- soapcl/ This article describes a simple, general purpose SOAP client in Java that uses no specialized SOAP libraries.... A general- purpose Java SOAP client... A simple SOAP client
58
Web Services Registries and UDDI
59
Why Do We Need a Web Services Registry Web services are valuable because of standardized payloads and transport definitions –The value is creating a web service that is used by many clients Can’t happen unless the services are advertised to multiple consumers
60
What Does UDDI Contain? Businesses and other service providers Services they expose Bindings (locations) of those services Interfaces supported by those services
61
UDDI Entities businessEntity – provider of service businessService – collection of related services bindingTemplate - information necessary to use tModel - “reusable concept” such as –Interface –Protocol used by web services –Category publisherAssertion - relationship that business entity has with another businessEntity Subscription – request to be informed of particular changes
62
Core UDDI Entities businessService Interface tModel bindingTemplate businessEntity bindingTemplate Interface tModel
63
Design Principles Keys as unique identifiers –Publisher assigned (new in V3) –Or generated by registry Containment and references –Keys inside elements are either contained entities or references to other entities Collections –Simple structure (e.g. name) just listed multiple times –Complex structure has container element (e.g. contacts on business Optional attributes –Empty not omitted –<keyedReference tModelKey=”uddi:uddi.org:ubr:categorization:iso3166” keyName=”” – keyValue=”US-CA”/>
64
businessEntity Structure
65
businessEntity Identifying Elements Uniquely identified by businessKey attribute discoveryURLs – http://www.example.com?businessKey=uddi:example.com:registr y:sales:53 Returns XML document of type businessEntity – http://www.acmewidgets.com name –Multiple names to do languages or abbreviations – –........ – 日本生花店 – ニッポンセイカテン – NIPPON FLOWERS – NF –..... – description –Multiple descriptions potentially in multiple languages with xml:lang
66
businessEntity contacts <
67
businessEntity Identifiers and Categories Optional IdentifierBag – <keyedReference tModelKey=”uddi:uddi.org:ubr:identifier:dnb.com:d-u-n-s” keyName=”SAP AG” keyValue=”31-626-8655” /> – Optional CategoryBag – <keyedReference tModelKey=”uddi:uddi.org:ubr:categorization:iso316 6” keyName=”California, USA” – keyValue=”US-CA” /> –
68
UDDI Keyed References tModelKey – –Required reference to tModel representing the identifier system (e.g. company identifier codes, geographical categories) keyName –Optional description of the identifier keyValue –Required identifier within the overall system
69
Keyed Reference Groups <keyedReference tModelKey=”uddi:uddi.org:ubr:categoriz ation:wgs84:latitude” keyName=”WGS 84 Latitude” keyValue=”+49.682700” /> <keyedReference tModelKey=”uddi:uddi.org:ubr:categori zation:wgs84:longitude” keyName=”WGS 84 Longitude” keyValue=”+008.295200” />
70
businessService
71
Uniquely identified by optional serviceKey attribute –Supplied by UDDI if not supplied by publisher Optional descriptions Optional categorizations in categoryBag One or more bindingTemplates Optional digital signature
72
bindingTemplates
73
bindingTemplate Uniquely identified by optional bindingKey attribute Optional serviceKey identifies service that contains this bindingTemplate descriptions accessPoint - network address (URL) hostingRedirector – deprecated categoryBag – e.g. can indicate that given template if status of “test” or production” tModelInstanceDetails -
74
tModelInstance Details
75
overviewDoc
76
tModels The “technical fingerprint” –tModel’s define unique identifiers for interfaces and interface specifications –Once tModel is published service advertises compliance with the spec represented by including the correct tModelKey Value sets –Categorization hierarchies –E.g. categoryBag and identifierBag have references to tModels with the system of values Find qualifiers –find_business uddi:uddi.org:findqualifier:sortbydateasc
77
tModel Structure
78
Exactly one non-empty name Zero or more descriptions Zero or more overviewDocs –useType=text –useType=wsdlInterface identifierBag –Contains tModelKey which uniquely identifies tModel (inconsistent?) –Other logical identifiers categoryBag –list of categories that describe specific aspects of the tModel
79
UDDI Keys Domain keys –uddi:acmewidgets.com UUID keys –uddi:4CD7E4BC-648B-426D-9936-443EAAC8AE23 Derived keys –uddi:tempuri.com:fish:buyingservice Key generator keys –Uddi:acmewidgets.com:keygenerator
80
UDDI Standard APIs
81
UDDI APIs Inquiry Publication Subscription Security Custody Transfer Replication
82
Inquiry API Patterns Browse –find_xx Drill-down –Use browse then drill-down –get_xx Invocation –Use browse and drilldown and get bindingTemplate –Invoke from bindingTemplate
83
Inquiry API Functions find_binding find_business find_relatedBusinesses find_service find_tModel get_bindingDetail get_businessDetail get_operationalInfo get_serviceDetail get_tModelDetail
84
find_binding
85
find_business
86
Find_business example uddi:uddi.org:findqualifier:approximatematch uddi:uddi.org:findqualifier:combinecategoryb ags
87
find_service
88
find_tModel
89
find_tModel Example uddi:uddi.org:findqualifier:caseinsensitivematch uddi:uddi.org:findqualifier:approximatematch rosetta%
90
Combined Searches uddi:uddi.org:findqualifier:sortbynameasc uddi:uddi.org:sortorder:uts-10 uddi:uddi.org:findqualifier:orallkeys uddi:some.specific.example:tmodelkey uddi:uddi.org:findqualifier:approximatematch uddi:uddi.org:findqualifier:caseinsensitivematch uddi:uddi.org:sortorder:uts-10 Rosetta%
91
Publication API save_binding save_business save_service save_tModel Delete_xx Xx_publisherAssertions
92
Mapping WSDL to UDDI UDDI technote (V2.0 in August 2003) regarding –How to take about WSDL objects and store them in UDDI equivalents –Enables queries on WSDL constituents (portTypes, operations, ports)
93
Overview
94
Wsdl:portType->uddi:tModel WSDLUDDI portTypetModel (categorized as portType) Namespace of portTypekeyedReference in categoryBag Local name of portTypetModel Name Location of WSDL Document overviewURL
95
portType->tModel StockQuotePortType http://location/sample.wsdl <keyedReference tModelKey="uuid:d01987d1-ab2e-3013-9be2-2a66eb99d824" keyName="portType namespace" keyValue="http://example.com/stockquote/" /> <keyedReference tModelKey="uuid:6e090afa-33e5-36eb-81b7- 1ca18373f457" keyName="WSDL type" keyValue="portType" />
96
WSDL Binding to UDDI tModel WSDLUDDI bindingtModel (categorized as binding and wsdlSpec) Namespace of bindingkeyedReference in categoryBag Local name of bindingtModel Name Location of WSDL DocumentoverviewURL portType reference and protocol references keyedReferences in category bag
97
StockQuoteSoapBinding http://location/sample.wsdl <keyedReference tModelKey="uuid:d01987d1-ab2e-3013-9be2-2a66eb99d824" keyName="binding namespace" keyValue="http://example.com/stockquote/" /> <keyedReference tModelKey="uuid:6e090afa-33e5-36eb-81b7-1ca18373f457" keyName="WSDL type" keyValue="binding" /> <keyedReference tModelKey="uuid:082b0851-25d8-303c-b332-f24a6d53e38e" keyName="portType reference" keyValue="uuid:e8cf1163-8234-4b35-865f-94a7322e40c3" /> <keyedReference tModelKey="uuid:4dc74177-7806-34d9-aecd-33c57dc3a865" keyName="SOAP protocol" keyValue= "uuid:aa254698-93de-3870-8df3-a5c075d64a0e" /> <keyedReference tModelKey="uuid:e5c43936-86e4-37bf-8196-1d04b35c0099" keyName="HTTP transport" keyValue=" uuid:68DE9E80-AD09-469D-8A37-088422BFBC36" /> <keyedReference tModelKey="uuid:c1acf26d-9672-4404-9d70-39b756e62ab4" keyName="uddi-org:types" keyValue="wsdlSpec" />
98
WSDL Service to UDDI Business Service WSDLUDDI ServicebusinessService (categorized as service) Namespace of ServicekeyedReference in categoryBag Local Name of ServicekeyedReference in categoryBag; optionally also the name of the service
99
WSDL Port to UDDI bindingTemplate WSDLUDDI portbindingTemplate Namespace Captured in keyedReference of the containing businessService Local name of port instanceParms of the tModelInstanceInfo relating to the tModel for the binding Binding implemented by port tModelInstanceInfo with tModelKey of the tModel corresponding to the binding portType implemented by port tModelInstanceInfo with tModelKey of the tModel corresponding to the portType
100
Business Service and Binding Templates <businessService serviceKey="102b114a-52e0-4af4-a292-02700da543d4" businessKey="1e65ea29-4e0f-4807-8098-d352d7b10368"> Stock Quote Service <bindingTemplate bindingKey="f793c521-0daf-434c-8700-0e32da232e74" serviceKey="102b114a-52e0-4af4-a292-02700da543d4"> http://location/sample <tModelInstanceInfo tModelKey="uuid:49662926-f4a5-4ba5-b8d0-32ab388dadda"> The wsdl:binding that this wsdl:port implements. The instanceParms specifies the port local name. StockQuotePort <tModelInstanceInfo tModelKey="uuid:e8cf1163-8234-4b35-865f-94a7322e40c3"> The wsdl:portType that this wsdl:port implements.
101
… and category bags for same <keyedReference tModelKey="uuid:6e090afa-33e5-36eb-81b7-1ca18373f457" keyName="WSDL type" keyValue="service" /> <keyedReference tModelKey="uuid:d01987d1-ab2e-3013-9be2-2a66eb99d824" keyName="service namespace" keyValue="http://example.com/stockquote/" /> <keyedReference tModelKey="uuid:2ec65201-9109-3919-9bec-c9dbefcaccf6" keyName="service local name" keyValue="StockQuoteService" />
102
Extending the Registry Categorization of tModels can be used to provide –Versioning of interfaces –QoS information on bindingTemplates
103
Versioning of tModels StockQuotePortType http://location/sample.wsdl <keyedReference tModelKey="uddi:uddi.org:versioning:minor-version" keyName="Minor Version" keyValue="1"/>
104
QoS Information on BindingTemplates Stock Quote Service http://location/sample This is the reference to the tModel that will have all of the QOS related categories attached. This points to the tModel that has the reference to the web service endpoint that allows detailed retrieval of information
105
The tModel with the QoS Information – QoS Information for Stock Quote Service http:// – – 10Mbps" />
106
Specs “Using WSDL in a UDDI Registry, Version 2.0.2” –http://www.oasis- open.org/committees/uddi- spec/doc/tn/uddi-spec-tc-tn-wsdl-v202- 20040631.htm
107
Articles.NET UDDI –Web Services Journal, “Microsoft UDDI SDK 2.0”, http://www.sys- con.com/webservices/article.cfm?id=544 –MSDN, “Using UDDI at Run Time, Part I”, http://msdn.microsoft.com/library/default.asp?url=/library/en- us/dnuddi/html/runtimeuddi1.asp - uses UDDI to query for other services for redundancy http://msdn.microsoft.com/library/default.asp?url=/library/en- us/dnuddi/html/runtimeuddi1.asp –MSDN, “Using UDDI and Run Time, Part II”, http://msdn.microsoft.com/library/default.asp?url=/library/en- us/dnuddi/html/runtimeuddi2.asp - uses UDDI to register service and then to query for instances of services supporting given tModel http://msdn.microsoft.com/library/default.asp?url=/library/en- us/dnuddi/html/runtimeuddi2.asp Extending UDDI –UDDI as an Extended Web Services Registry: Versioning, quality of service, and more”, Blum Web Services Journal, June 2004, http://www.sys-con.com/story/?storyid=45102&DE=1http://www.sys-con.com/story/?storyid=45102&DE=1 – “Extending UDDI with robust Web services information”, Blum http://searchwebservices.techtarget.com/originalContent/0,289142,sid26_gci952129,00.html
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.