Session I Part II: WS Standards

Post on 21-Jan-2016

25 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Session I Part II: WS Standards. Umesh Bellur IIT Bombay umesh[at]it.iitb.ac.in. Session II: Contents. XML Basics WS Core Standards: WSDL SOAP UDDI. Basic SOAP Message Exchange. WSDL describing service. Exposing Program Service Provider. Consuming Program Service Requestor. - PowerPoint PPT Presentation

Transcript

Session I Part II: WS Standards

Umesh BellurIIT Bombay

umesh[at]it.iitb.ac.in

Session II: Contents

• XML Basics• WS Core Standards:

– WSDL– SOAP– UDDI

Basic SOAP Message Exchange

ConsumingProgram

Service Requestor

ExposingProgram

ServiceProvider

http transport

SOAPmessage

WSDLdescribing

service

Service Registry

UDDI

discover services

WSDLsdescribingservices

SOAPmessage

http transport

SOAP Message

Sample SOAP Message<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">

<env:Header> <n:alertcontrol xmlns:n="http://example.org/alertcontrol">

<n:priority>1</n:priority>

<n:expires>2001-06-22T14:00:00-05:00</n:expires> </n:alertcontrol> </env:Header>

<env:Body> <m:alert xmlns:m="http://example.org/alert"><m:msg>Pick up Mary at school at 2pm</m:msg></m:alert>

</env:Body>

</env:Envelope>

Conversational Message Exchange

buyer

seller

seller

seller

messagebroker

RFQ

QuoteResponse

Award

Conversational SOAP Message Exchange: A Request

<?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">

<env:Header> <r:RFQNum xmlns:r=“http://bigco.example.org/RFQ”

env:mustUnderstand=“true”>101</r:RFQNum><r:custNum env:mustUnderstand=“true”>17</r:custNum>

</env:Header><env:Body>

<r:RFQ xmlns:r=“http://bigco.example.org/RFQ”><r:manufacturer>SanDisk</r:<Manufacturer><r:productname>SecureDigital memory</r:productname><r:size>1GB</r:size><r:substitutable/><r:quantity>100</r:quantity></r:RFQ>

</env:Body></env:Envelope>

Conversational Exchange: A Response

<?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">

<env:Header> <r:RFQNum xmlns:r=“http://bigco.example.org/RFQ”>env:mustUnderstand=“true”>101</m:RFQNum><r:vendorID env:mustUnderstand=“true”>2470</r:vendorID><r:bidNum env:mustUnderstand=“true”>1</r:RFQNum><r:custNum env:mustUnderstand=“true”>17<r:custNum>

</env:Header><env:Body>

<r:quoteRespons xmlns:r=“http://bigco.example.org/RFQ”><r:manufacturer>KingMax</r:<Manufacturer><r:productName>SecureDigital memory</r:productname><r:size>1GB</r:size><r:speed>9000KB/s</r:speed><r:VendorName URL=“http://memunlim.com”>Memories

Unlimited</r:VendorName><r:SKU>KM-SD1000</r:SKU><r:quantity>100</r:quantity>

</r:quoteResponse></env:Body>

</env:Envelope>

Conversational Exchange:Completion

<?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">

<env:Header> <r:vendorID env:mustUnderstand=“true”>2470</r:vendorID><r:bidNum env:mustUnderstand=“true”>1</r:bidNum><r:custNum env:mustUnderstand=“true”>17<r:custNum>

</env:Header><env:Body>

<r:Award xmlns:r=“http://bigco.example.org/RFQ”><r:SKU>KM-SD1000</r:SKU><r:quantity>50</r:quantity>

</r:Award></env:Body>

</env:Envelope>

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

RPC Invocation

<?xml version='1.0' ?><env:Envelope

xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Header><t:transaction xmlns:t=“http://shippingservice.org/transaction” env:encodingStyle=“http://shippingservice.org/encoding” env:mustUnderstand=“true”>5</t:transaction></env:Header>

Body

<env:Body>

<s:shipOrder xmlns:s=“http://shippingservice.org”>

<s:origin env:encodingStyle="http://www.w3.org/2003/05/soap-encoding" >

<r:vendorID xmlns:r=“http://bigco.example.org/RFQ”>

2470

</r:vendorID>

</s:origin>

<s:destination>

<r:custNum env:mustUnderstand=“true”>17<r:custNum>

</s:destination>

<s:weight>500g</s:weight>

</s:shipOrder>

</env:Body>

</env:Envelope>

RPC Result<?xml version='1.0' ?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"

><env:Header><t:transaction xmlns:t=“http://shippingservice.org/transaction” env:encodingStyle=“http://paymentservice.org/encoding” env:mustUnderstand=“true”>5</t:transaction></env:Header>

<env:Body><s:shipOrderResponse env:encodingStyle=“http://www.w3.org/2003/05/soap-encoding”xmlns:rpc=“http://www.w3.org/2003/05/soap-rpc”xmlns:s=“http://shippingservice.org”>

<rpc:result>s:status</rpc:result><s:status>confirmed</s:status><s:amount>$20.00</s:amount>

</s:shipOrderResponse></env:Body> </env:Envelope>

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

SOAP Fault Example<?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"

xmlns:rpc='http://www.w3.org/2003/05/soap-rpc'> <env:Body>

<env:Fault> <env:Code>

<env:Value>env:Sender</env:Value> <env:Subcode>

<env:Value>rpc:BadArguments</env:Value> </env:Subcode>

</env:Code> <env:Reason>

<env:Text xml:lang="en-US">Processing error</env:Text> <env:Text xml:lang="cs">Chyba zpracování</env:Text>

</env:Reason> <env:Detail>

<e:myFaultDetails xmlns:e="http://shippingservice.org/faults"> <e:message>Unknown destination</e:message> <e:errorcode>999</e:errorcode>

</e:myFaultDetails> </env:Detail>

</env:Fault> </env:Body> </env:Envelope>

SOAP Faults on MustUnderstand

<?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope><env:Header> <env:NotUnderstood qname="t:transaction"

xmlns:t="http://shippingservice.org/transaction"/> </env:Header> <env:Body>

<env:Fault> <env:Code>

<env:Value>env:MustUnderstand</env:Value> </env:Code> <env:Reason> <env:Text xml:lang="en-US">Header not

understood</env:Text> <env:Text xml:lang="fr">En-tête non compris</env:Text> </env:Reason>

</env:Fault> </env:Body> </env:Envelope>

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)

SOAP Extensibility in Practice

<S:Envelope ...><S:Header><wsa:ReplyTo>

<!-- WS-Addressing header block --><wsa:Address>http://bigco.example.org/buyer</wsa:Address></wsa:ReplyTo>

<wssec:Security> <wssec:BinarySecurityToken ValueType=”wssec:X509v3”

encodingType=”wssec:Base64Binary”>dhw6weiurU982ndya73jdVBGt2567...d79HID7ghd652ad2

</wssec:BinarySecurityToken><wsrm:Sequence>

<wsu:Identifier>http://f123.com/sq14<wsu:Identifier><wsrm:MessageNumber>10</wsrm:MessageNumber>

</wsrm:Sequence></S:Header><S:Body>...</S:Body></S:Envelope>

SOAP Processing: Header Blocks, MustUnderstand and Relay

<?xml version="1.0" ?> <env:Envelope

xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <env:Header>

<p:oneBlock xmlns:p="http://example.com" env:role="http://example.com/Log" env:mustUnderstand="true"> ... </p:oneBlock>

<q:anotherBlock xmlns:q="http://example.com" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:relay="true"> ... ...</q:anotherBlock>

<r:aThirdBlock xmlns:r="http://example.com"> ... ... </r:aThirdBlock>

</env:Header>

<env:Body > ... ... </env:Body></env:Envelope>

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

SOAP HTTP Binding Example

• POST /Reservations HTTP/1.1• Host: marketplace.example.org• Content-Type: application/soap+xml;

charset="utf-8"• Content-Length: nnnn• <?xml version='1.0' ?>• <env:Envelope xmlns:env=”...”>• <env:Body>

– <r:RFQ>

SOAP SMTP Binding Example

From: buyer@bigco.example.orgTo: rfqs@marketplace.example.orgSubject: RFQ: Memory purchaseDate: Thursday, September 9 2004Message-Id: <17-101@bigco.example.org>Content-Type: application/soap+xml<?xml version='1.0' ?><env:Envelope xmlns:env=”...”><env:Body>

SOAP Remoting Architecture

Server objectimplementation

application levelClient application code

Server skeleton

XML unmarshaller

Client stub

XML marshaller

TCP/IP socket

remoting architecture level

wire protocol levelhttp protocol httpserver

httpserver

body

envelopeheader header

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

CORBAServer object

implementationapplication levelClient application code

Server skeleton

Corba runtime

Implementationrepository

Client stub

Corba runtimeImplementation

repository

ORBORB

TCP/IP socket

CORBA Dynamic Invocation

Server objectimplementation

application level

Client application code

Server skeleton

Corba runtime

Implementationrepository

Client stub

Corba runtime

Implementationrepository

ORBORB

TCP/IP socket

binding method

Remoting architecture level

Wire protocol level

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 -

DCOM and DCE RPCServer object

implementation

application level

Client application- code

Server stub

COM runtime

Client proxy

COM runtime

SCMSCM

RPC channel

binding method

Remoting architecture level

Wire protocol level

registry registry

OXID ResolverPing client/server

DCOM Object CreationServer object

implementation

application level

Client application- code

Server stub

COM runtime

Client proxy

COM runtime

SCMSCM

RPC channel

binding method

Remoting architecture level

Wire protocol level

registry registry

OXID ResolverPing client/server

DCOM Object InvocationServer object

implementation

application level

Client application- code

Server stub

COM runtime

Client proxy

COM runtime

SCMSCM

RPC channel

binding method

Remoting architecture level

Wire protocol level

registry registry

OXID ResolverPing client/server

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

Java RMIServer object

implementation

application level

Client application- code

Server skeleton

Remote ReferenceLayer

Client stub

Remote ReferenceLayer

Transport Layer

binding method

remoting architecture level

wire protocol level

Transport Layer

TCP/IP Socket

RMIRegistry

JRMP signature (JRMI)

version

protocol

SingleOpProtocolStreamProtocolMultiplexProtocol

Message(serialized arguments based On Java’s Object Serialization

Protocol)

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

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

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

Web Services Description Language (WSDL)

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

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.

WSDL Specification

types

message message message

operation

porttype

operation operation

binding

serviceport

An Example - WSDL Types

<?xml version="1.0"?> <definitions name="StockQuote"

targetNamespace="http://example.com/stockquote.wsdl" xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd" xmlns:soap="http://schems.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">

<types>

<schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2000/10/XMLSchema">

<element name="TradePriceRequest">

<complexType><all><element name="tickerSymbol" type="string"/> </all>

</complexType>

</element>

<element name="TradePrice">

<complexType><all><element name="price”

type="float"/></all></complexType>

</element>

</schema>

</types>

WSDL Operations

<message name="GetLastTradePriceInput"> <part name="body" element="xsd1:TradePriceRequest"/> </message>

<message name="GetLastTradePriceOutput"> <part name="body" element="xsd1:TradePrice"/></message>

<portType name="StockQuotePortType"><operation name="GetLastTradePrice">

<input message="tns:GetLastTradePriceInput"/> <output message="tns:GetLastTradePriceOutput"/> </operation>

</portType>

WSDL Bindings, Services, Ports

<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">

<soap:binding style="document“ transport="http://schemas.xmlsoap.org/soap/http"/>

<operation name="GetLastTradePrice"> <soap:operation

soapAction="http://example.com/GetLastTradePrice"/>

<input><soap:body use="literal"/></input>

<output><soap:body use="literal"/></output> </operation>

</binding>

<service name="StockQuoteService"> <documentation>My first service</documentation>

<port name="StockQuotePort" binding="tns:StockQuoteBinding"> <soap:address location="http://example.com/stockquote"/>

</port>

</service>

</definitions>

Import for Types<?xml version="1.0"?> <definitions name="StockQuote"

targetNamespace="http://example.com/stockquote/definitions" xmlns:tns="http://example.com/stockquote/definitions" xmlns:xsd1="http://example.com/stockquote/schemas" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">

<import namespace="http://example.com/stockquote/schemas" location="http://example.com/stockquote/stockquote.xsd"/>

<message name="GetLastTradePriceInput"> <part name="body" element="xsd1:TradePriceRequest"/></message>

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

WSDL Binding Example:One-way Over SMTP

<message name="SubscribeToQuotes"> <part name="body" element="xsd1:SubscribeToQuotes"/> <part name="subscribeheader" element="xsd1:SubscriptionHeader"/>

</message> <portType name="StockQuotePortType">

<operation name="SubscribeToQuotes"> <input message="tns:SubscribeToQuotes"/></operation>

</portType> <binding name="StockQuoteSoap" type="tns:StockQuotePortType">

<soap:binding style="document" transport="http://example.com/smtp"/> <operation name="SubscribeToQuotes"> <input message="tns:SubscribeToQuotes"> <soap:body parts="body" use="literal"/> <soap:header message="tns:SubscribeToQuotes" part="subscribeheader"

use="literal"/> </input> </operation>

</binding> <service name="StockQuoteService">

<port name="StockQuotePort" binding="tns:StockQuoteSoap"> <soap:address location="mailto:subscribe@example.com"/>

</port> </service>

Request-Response RPC Over HTTP

<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType"> • <soap:binding style="rpc"

transport="http://schemas.xmlsoap.org/soap/http"/> • <operation name="GetTradePrice">

– <soap:operation soapAction="http://example.com/GetTradePrice"/> – <input>

<soap:body use="encoded" namespace="http://example.com/stockquote" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>

– </input> – <output>

<soap:body use="encoded" namespace="http://example.com/stockquote" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>

– </output> • </operation>> </binding>

<service name="StockQuoteService"> <documentation>My first service</documentation><port name="StockQuotePort" binding="tns:StockQuoteBinding"> <soap:address location="http://example.com/stockquote"/></port>

</service>

Web Services Survey

• Public APIs– Google – Amazon

• Business APIs– SalesForce– Siebel CRM OnDemand

Google’s WSDL Messages

<message name="doGetCachedPage"> <part name="key" type="xsd:string" /> <part name="url" type="xsd:string" />

</message> <message name="doGetCachedPageResponse">

<part name="return" type="xsd:base64Binary" /> </message> <message name="doSpellingSuggestion"> <part name="key"

type="xsd:string" /> <part name="phrase" type="xsd:string" /> </message>

<message name="doSpellingSuggestionResponse"> <part name="return" type="xsd:string" />

</message>

<message name="doGoogleSearch">

<part name="key" type="xsd:string" />

<part name="q" type="xsd:string" />

<part name="start" type="xsd:int" />

<part name="maxResults" type="xsd:int" />

<part name="filter" type="xsd:boolean" />

<part name="restrict" type="xsd:string" />

<part name="safeSearch" type="xsd:boolean" />

<part name="lr" type="xsd:string" />

<part name="ie" type="xsd:string" />

<part name="oe" type="xsd:string" />

</message>

<message name="doGoogleSearchResponse">

<part name="return" type="typens:GoogleSearchResult" />

</message>

Google’s PortTYPE

<portType name="GoogleSearchPort"> <operation name="doGetCachedPage">

<input message="typens:doGetCachedPage" /> <output message="typens:doGetCachedPageResponse"/> </operation> <operation name="doSpellingSuggestion">

<input message="typens:doSpellingSuggestion"/> <output

message="typens:doSpellingSuggestionResponse"/> </operation> <operation name="doGoogleSearch">

<input message="typens:doGoogleSearch"/> <output message="typens:doGoogleSearchResponse"/> </operation>

</portType>

Google Bindings and Endpoint

<binding name="GoogleSearchBinding" type="typens:GoogleSearchPort"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />

<operation name="doGoogleSearch"> <soap:operation soapAction="urn:GoogleSearchAction" /> <input>

<soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />

</input> <output>

<soap:body use="encoded" namespace="urn:GoogleSearch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /

</output> </operation>

</binding> <service name="GoogleSearchService">

<port name="GoogleSearchPort“ binding="typens:GoogleSearchBinding"> <soap:address location=http://api.google.com/search/beta2/></port>

</service>

Google Search Request<soap:Envelope xmlns:mrns0="urn:GoogleSearch"

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<mrns0:doGoogleSearch> <key xsi:type="xs:string">XXrPsWdQFHKLrnHP5BRLENvY9mRSoAsI</key> <q xsi:type="xs:string">Java SOAP</q> <start xsi:type="xs:int">0</start> <maxResults xsi:type="xs:int">10</maxResults> <filter xsi:type="xs:boolean">false</filter> <restrict xsi:type="xs:string" /> <safeSearch xsi:type="xs:boolean">false</safeSearch> <lr xsi:type="xs:string" /> <ie xsi:type="xs:string" /> <oe xsi:type="xs:string" /> </mrns0:doGoogleSearch>

</soap:Body> </soap:Envelope>

Search Response

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">

<SOAP-ENV:Body> <ns1:doGoogleSearchResponse SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:GoogleSearch"> <return xsi:type="ns1:GoogleSearchResult">

<resultElements xsi:type="ns3:Array" ns3:arrayType="ns1:ResultElement[10]" xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/">

<item xsi:type="ns1:ResultElement">

URL xsi:type="xsd:string">http://www-106.ibm.com/developerworks/xml/library/x-soapcl/</URL> <snippet xsi:type="xsd:string">This article describes a simple, general purpose <b>SOAP</b> client in <b>Java</b> that uses<br> no specialized <b>SOAP</b> libraries. <b>...</b> A general-purpose <b>Java</b> <b>SOAP</b> client <b>...</b> </snippet> <summary xsi:type="xsd:string" /> <title xsi:type="xsd:string">A simple <b>SOAP</b> client</title>

</item>

</resultElements>

</return> </ns1:doGoogleSearchResponse>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Web Services Registriesand UDDI

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

What Does UDDI Contain?

• Businesses and other service providers

• Services they expose• Bindings (locations) of those

services• Interfaces supported by those

services

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

Core UDDI Entities

businessService

businessService

Interface tModelbindingTemplate

bindingTemplate

businessEntity

bindingTemplateInterface tModel

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”/>

businessEntity Structure

businessEntity Identifying Elements

• Uniquely identified by businessKey attribute• discoveryURLs

– <discoveryURL useType=”businessEntity”>http://www.example.com?businessKey=uddi:example.com:registry:sales:53</discoveryURL>

• Returns XML document of type businessEntity– <discoveryURL useType=”homepage”>

    http://www.acmewidgets.com</discoveryURL>• name

– Multiple names to do languages or abbreviations– <businessEntity . . . >–   ........–   <name xml:lang="ja">日本生花店 </name>–   <name xml:lang="ja">ニッポンセイカテン </name>–   <name xml:lang="en">NIPPON FLOWERS </name>–   <name xml:lang="en">NF</name>–   .....– </businessEntity>

• description– Multiple descriptions potentially in multiple languages with xml:lang

businessEntity contacts

<

businessEntity Identifiers and Categories

• Optional IdentifierBag– <identifierBag>

    <keyedReference      tModelKey=”uddi:uddi.org:ubr:identifier:dnb.com:d-u-n-s”      keyName=”SAP AG”

•         keyValue=”31-626-8655” />– </identifierBag>

• Optional CategoryBag– <categoryBag>

   <keyedReference    tModelKey=”uddi:uddi.org:ubr:categorization:iso3166”    keyName=”California, USA”

–     keyValue=”US-CA” />– </categoryBag>

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

Keyed Reference Groups

<keyedReferenceGroup tModelKey=”uddi:uddi.org:ubr:categorizationGroup:wgs84” >    <keyedReference        tModelKey=”uddi:uddi.org:ubr:categorization:wgs84:latitude”        keyName=”WGS 84 Latitude”

        keyValue=”+49.682700” />     <keyedReference

         tModelKey=”uddi:uddi.org:ubr:categorization:wgs84:longitude”         keyName=”WGS 84 Longitude”

         keyValue=”+008.295200” /></keyedReferenceGroup>

businessService

businessService

• 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

bindingTemplates

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 -

tModelInstance Details

overviewDoc

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

tModel Structure

tModel Structure

• 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

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

UDDI Standard APIs

UDDI APIs

• Inquiry• Publication• Subscription• Security• Custody Transfer• Replication

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

Inquiry API Functions

• find_binding• find_business• find_relatedBusinesses• find_service• find_tModel

• get_bindingDetail• get_businessDetail• get_operationalInfo• get_serviceDetail• get_tModelDetail

find_binding

find_business

Find_business example• <find_business xmlns="urn:uddi-org:api_v3">

  <findQualifiers>    <findQualifier>       uddi:uddi.org:findqualifier:approximatematch    </findQualifier>    <findQualifier>       uddi:uddi.org:findqualifier:combinecategorybags    </findQualifier>  </findQualifiers>  <categoryBag>    <keyedReference keyValue="34.10.%"        tModelKey="uddi:uddi.org:ubr:categorization:unspsc"/>  </categoryBag></find_business>

find_service

find_tModel

find_tModel Example<find_tModel xmlns="urn:uddi-org:api_v3">

  <findQualifiers>    <findQualifier>

uddi:uddi.org:findqualifier:caseinsensitivematch    </findQualifier>    <findQualifier>       uddi:uddi.org:findqualifier:approximatematch    </findQualifier>  </findQualifiers>  <name>rosetta%</name></find_tModel>

Combined Searches<find_business xmlns="urn:uddi-org:api_v3">

  <findQualifiers>    <findQualifier>       uddi:uddi.org:findqualifier:sortbynameasc    </findQualifier>    <findQualifier>       uddi:uddi.org:sortorder:uts-10    </findQualifier>    <findQualifier>       uddi:uddi.org:findqualifier:orallkeys    </findQualifier>  </findQualifiers>  <!--find businesses that have bindings that reference       this fixed tModel -->  <tModelBag>    <tModelKey>uddi:some.specific.example:tmodelkey</tModelKey>  </tModelBag>  <!--OR one of the RosettaNet tModels -->  <find_tModel xmlns="urn:uddi-org:api_v3">    <findQualifiers>      <findQualifier>         uddi:uddi.org:findqualifier:approximatematch      </findQualifier>      <findQualifier>         uddi:uddi.org:findqualifier:caseinsensitivematch      </findQualifier>      <findQualifier>         uddi:uddi.org:sortorder:uts-10      </findQualifier>    </findQualifiers>    <name>Rosetta%</name>  </find_tModel></find_business>

Publication API

• save_binding• save_business• save_service• save_tModel• Delete_xx• Xx_publisherAssertions

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)

Overview

Wsdl:portType->uddi:tModel

WSDL UDDI

portType tModel (categorized as portType)

Namespace of portType

keyedReference in categoryBag

Local name of portType

tModel Name

Location of WSDL Document

overviewURL

portType->tModel• <tModel tModelKey="uuid:e8cf1163-8234-4b35-865f-94a7322e40c3" >•     <name>•          StockQuotePortType•     </name>•     <overviewDoc>•          <overviewURL>•              http://location/sample.wsdl•          <overviewURL>•     <overviewDoc>•     <categoryBag>•          <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" />•     </categoryBag>• </tModel>

WSDL Binding to UDDI tModel

WSDL UDDI

binding tModel (categorized as binding and wsdlSpec)

Namespace of binding keyedReference in categoryBag

Local name of binding tModel Name

Location of WSDL Document

overviewURL

portType reference and protocol references

keyedReferences in category bag

• <tModel tModelKey="uuid:49662926-f4a5-4ba5-b8d0-32ab388dadda">• <name>StockQuoteSoapBinding</name>•     <overviewDoc>•          <overviewURL>•              http://location/sample.wsdl•          </overviewURL>•     </overviewDoc>•     <categoryBag>•          <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" />•     </categoryBag>• </tModel>

WSDL Service to UDDI Business Service

WSDL UDDI

Service businessService (categorized as service)

Namespace of Service keyedReference in categoryBag

Local Name of Service keyedReference in categoryBag; optionally also the name of the service

WSDL Port to UDDI bindingTemplate

WSDL UDDI

port bindingTemplate

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 

Business Service and Binding Templates• <businessService

•          serviceKey="102b114a-52e0-4af4-a292-02700da543d4" •          businessKey="1e65ea29-4e0f-4807-8098-d352d7b10368">•     <name>Stock Quote Service</name>•     <bindingTemplates>•          <bindingTemplate •              bindingKey="f793c521-0daf-434c-8700-0e32da232e74" •              serviceKey="102b114a-52e0-4af4-a292-02700da543d4">•              <accessPoint URLType="http">•                  http://location/sample•              </accessPoint>•              <tModelInstanceDetails>•                  <tModelInstanceInfo •                       tModelKey="uuid:49662926-f4a5-4ba5-b8d0-32ab388dadda">•                       <description xml:lang="en">•                           The wsdl:binding that this wsdl:port implements. The instanceParms

specifies the port local name.•                       </description>•                       <instanceDetails>•                           <instanceParms>StockQuotePort</instanceParms>•                       </instanceDetails>•                  </tModelInstanceInfo>•                  <tModelInstanceInfo •                       tModelKey="uuid:e8cf1163-8234-4b35-865f-94a7322e40c3">•                       <description xml:lang="en">•                           The wsdl:portType that this wsdl:port implements.•                       </description>•                  </tModelInstanceInfo>•              </tModelInstanceDetails>•          </bindingTemplate>•     </bindingTemplates>•    

… and category bags for same

• <categoryBag>•     <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" />• </categoryBag>• </businessService>

Extending the Registry

• Categorization of tModels can be used to provide– Versioning of interfaces– QoS information on

bindingTemplates

Versioning of tModels<tModel tModelKey="uddi:mycompany.com:stockquoteporttype">

<name>StockQuotePortType</name> <overviewDoc> <overviewURL> http://location/sample.wsdl <overviewURL> <overviewDoc> <categoryBag> <keyedReference tModelKey="uddi:uddi.org:versioning:major-version" keyName="Major Version" keyValue="2"/> <keyedReference tModelKey="uddi:uddi.org:versioning:minor-version" keyName="Minor Version" keyValue="1"/> <keyedReference tModelKey="uddi:uddi.org:versioning:revision-number" keyName="Revision Number" keyValue="Build 1241"/> <keyedReference tModelKey="uddi:uddi.org:versioning:milestone" keyName="Milestone" keyValue="latest-revision"/> <keyedReference tModelKey="uddi:uddi.org:versioning:versioning-component" keyName="Versioning Component" keyValue="StockQuoteSampleComponent"/> <keyedReference tModelKey="uddi:uddi-org:xml:namespace" keyName="portType namespace" keyValue="http://example.com/stockquote/"/> <keyedReference tModelKey="uddi:uddi-org:wsdl:types" keyName="WSDL type" keyValue="portType"/> </categoryBag>

</tModel>

QoS Information on BindingTemplates

<businessService serviceKey="uddi:mycompany.com:StockQuoteService" businessKey="uddi:mycompany.com:business> <name>Stock Quote Service</name> <bindingTemplates> <bindingTemplate bindingKey="uddi:mycompany.com:StockQuoteService:primaryBinding" serviceKey="uddi:mycompany.com:StockQuoteService"> <accessPoint URLType="http">http://location/sample </accessPoint> <tModelInstanceDetails>

<tModelInstanceInfo tModelKey="uddi:mycompany.com:StockQuoteService:PrimaryBinding:QoSInformation">

<description xml:lang="en"> This is the reference to the tModel that will have all of the QOS related categories attached. </description> </tModelInstanceInfo> <tModelInstanceInfo

tModelKey="uddi:mycompany.com:StockQuoteService:Primary Binding:QoSDetail">

<description xml:lang="en"> This points to the tModel that has the reference to the web

service endpoint that allows detailed retrieval of information </description> </tModelInstanceInfo>

</tModelInstanceDetails> </bindingTemplate> </bindingTemplates>

</businessService>

The tModel with the QoS Information

• <tModel tModelKey="mycompany.com:StockQuoteService: PrimaryBinding:QoSInformation"" > – <name> QoS Information for Stock Quote Service </name>

<overviewDoc> • <overviewURL> http://<URL describing schema of QoS attributes> <overviewURL>

– <overviewDoc> • <categoryBag>

– <keyedReference tModelKey="uddi:uddi.org:QoS:ResponseTime" keyName="Average ResponseTime" keyValue="fast" /> <keyedReference tModelKey="uddi:uddi.org:QoS:Throughput" keyName="Average Throughput" keyValue=">10Mbps" /> <keyedReference tModelKey="uddi:uddi.org:QoS:Reliability" keyName="Average Reliability" keyValue="99.9%" />

• </categoryBag> • </tModel>

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

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

– 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

• 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=1– “Extending UDDI with robust Web services information”, Blum

• http://searchwebservices.techtarget.com/originalContent/0,289142,sid26_gci952129,00.html

top related