Presentation is loading. Please wait.

Presentation is loading. Please wait.

In Introduction to Web Services

Similar presentations


Presentation on theme: "In Introduction to Web Services"— Presentation transcript:

1 In Introduction to Web Services

2 Publish-Find-Bind Consuming Program Service Provider Service Requestor
WSDL describing service Consuming Program Service Requestor Service Provider SOAP message http transport SOAP message http transport Discover services Publish services Service Registry UDDI

3 SOAP Message Body - Payload Why header? Extensibility
Control/meta Information Header is optional SOAP Intermediaries <env:Envelope xmlns:env=" <env:Header> </env:Header> <env:Body> </env:Body> </env:Envelope>

4 SOAP Architecture application level Client application code Service
implementation Server skeleton Client stub XML marshaller XML unmarshaller remoting architecture level envelope header header body http protocol http client http server wire protocol level TCP/IP socket

5 Conversational Message Exchange
seller buyer message broker RFQ seller QuoteResponse Award seller

6 Conversational Message Exchange: A Request
<?xml version='1.0' ?> <env:Envelope xmlns:env=" <env:Header> <r:RFQNum xmlns:r=“…” env:mustUnderstand=“true”>101</r:RFQNum> <r:custNum env:mustUnderstand=“true”>17</r:custNum> </env:Header> <env:Body> <r:RFQ xmlns:r=“ <r:manufacturer>SanDisk</r:<Manufacturer> <r:productname>SecureDigital memory</r:productname> <r:size>1GB</r:size> <r:quantity>100</r:quantity> </r:RFQ> </env:Body> </env:Envelope>

7 Conversational Message Exchange: A Response
<?xml version='1.0' ?> <env:Envelope xmlns:env=" <env:Header> <r:RFQNum xmlns:r=“ env:mustUnderstand=“true”>101</m:RFQNum> <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:quoteResponse xmlns:r=“ <r:manufacturer>KingMax</r:<Manufacturer> <r:productName>SecureDigital memory</r:productname> <r:size>1GB</r:size> <r:speed>9000KB/s</r:speed> <r:SKU>KM-SD1000</r:SKU> <r:quantity>100</r:quantity> </r:quoteResponse> </env:Body> </env:Envelope>

8 Conversational Message Exchange: Completion
<?xml version='1.0' ?> <env:Envelope xmlns:env=" <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=“ <r:SKU>KM-SD1000</r:SKU> <r:quantity>50</r:quantity> </r:Award> </env:Body> </env:Envelope>

9 SOAP Faults Place faults inside env:Body elements env:Fault Element:
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

10 SOAP Fault Examples <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= <e:message>Unknown destination</e:message> <e:errorcode>999</e:errorcode> </e:myFaultDetails> </env:Detail> </env:Fault> </env:Body>

11 SOAP Bindings Transport of SOAP messages from one SOAP node to another
Serialized representation of the message 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> From: To: Subject: RFQ: Memory purchase Date: Thursday, September Message-Id: Content-Type: application/soap+xml

12 WSDL: Introduction Contract of a web service published by the provider
XML-based Service Description W3C Candidate Recommendation Describe a Web Service? Operations Message Exchange Pattern Messages Protocol, Address WSDL Approach: Abstract service description Concrete network protocol and message format Binding [Abstract -> Concrete]

13 WSDL: Specification types message message message portType/interface
<definitions name="StockQuote" … > <types>…</types> <message>…</message> <portType> <operation> … </operation> </portType> <binding>…</binding> <service>…</service> </definitions> message message message portType/interface operation operation operation binding service port / endpoint

14 WSDL Types <types>
Data type definitions using some type system (such as XSD) <types> <schema targetNamespace=“…“ xmlns=" <complexType name=“StockIdentifier">       <sequence>         <element name=“Symbol“ type="xsd:string"/>         <element name=“StockMarket“ type="xsd:sting"/>       </sequence> </complexType> </schema> </types> External Schemas can be imported into the WSDL <import namespace=" location= />

15 WSDL PortType, Operation, Message
<portType name="StockPriceInterface"> <operation name=“GetStockPrice"> <input message="tns:GetStockPriceInput"/> <output message="tns:GetStockPriceOutput"/> </operation> </portType> <message name="GetStockPriceInput"> <part name=“stock" element=“xsd1:StockIdentifier"/> <part name=“time" element="xsd:date"/> </message> <message name="GetStockPriceOutput"> <part name=“value" element="xsd:float"/>

16 WSDL Binding Maps the abstract service functionality to a specific network protocol and message format Bindings defined for HTTP, SMTP etc.. <binding name="StockQuoteSOAPBinding" type="tns:StockQuotePortType"> <soap:binding style="document“ transport=" <operation name="GetStockPrice"> <soap:operation soapAction=" <input><soap:body use="literal"/></input> <output><soap:body use="literal"/></output> </operation> </binding>

17 WSDL Ports and Services
Port: A single endpoint defined as a combination of a binding and a network address. Service: A collection of related endpoints. <service name="StockQuoteService"> <documentation>My first service</documentation> <port name="StockQuotePort" binding="tns:StockQuoteSOAPBinding"> <soap:address location=" </port> </service>

18 WSDL Binding Example: One-way Over SMTP
<message name="SubscribeToQuotes"> <part name=“subsBody" element="xsd1:SubscribeToQuotes"/> <part name="subsHeader"element="xsd1:SubscriptionHeader"/> </message> <portType name="StockQuotePortType"> <operation name="SubscribeToQuotesOper"> <input message="tns:SubscribeToQuotes"/> </operation> </portType> <binding name="StockQuoteSoap" type="tns:StockQuotePortType"> <soap:binding style="document" transport=" <input message="tns:SubscribeToQuotes"> <soap:body parts=“subsBody" use="literal"/> <soap:header part="subsHeader" use="literal"/> </input> </binding> <service name="StockQuoteService"> <port name="StockQuotePort" binding="tns:StockQuoteSoap"> <soap:address </port> </service>

19 UDDI Interface Protocol used by web services Category
Universal Description, Discovery and Integration 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 UUID (Universally Unique IDs) as Keys businessKey, serviceKey, bindingKey , tModelKey

20 Core UDDI Entities businessEntity Interface tModel bindingTemplate
businessService bindingTemplate bindingTemplate Interface tModel businessService bindingTemplate

21 tModels The “technical fingerprint” Value sets
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

22 UDDI APIs Inquiry Browse: find_xx Drill-down: get_xx Invocation
Use browse and drilldown and get bindingTemplate Invoke from bindingTemplate Publication save_xx delete_xx Subscription, Security, Custody Transfer, Replication <find_business xmlns="urn:uddi-org:api_v3"> <findQualifiers> <findQualifier>uddi:uddi.org:findqualifier:approximatematch</findQualifier> ... </findQualifiers> <categoryBag> <keyedReference keyValue="34.10.%“ tModelKey="uddi:uddi.org:ubr:categorization:unspsc"/> </categoryBag> </find_business>

23 Mapping WSDL to UDDI

24 The value proposition of SOA
Implement SOA for two major reasons. First is the ability to save development dollars through reuse of services. Second is the ability to change the IT infrastructure faster to adapt to changing needs of the business, or agility.

25 The vision: a true SOA Scenario
Describe the semantics of a client’s need Discover a provider of this need or compose multiple services dynamically Dynamically understand the protocol of messages to be exchanged with the provider Negotiate terms of use of a Service Move from one provider to another seamlessly

26 SOA Fabric Requirements
Publish-Find-Bind paradigm++ Semantics (IOPE) Context awareness Trust models Declarative and dynamic composition Fabric services similar to “middleware services” of the past Transactions, naming etc. Non repudiation Metering and Billing (S-Commerce) Differentiated service levels along with dynamic provisioning of services

27 Whither WS? Many new standards are being formulated that extend WS with these capabilities WSRF – for stateful interactions WS Policy – Capabilities and constraint specification C-WSDL – Context awareness WS-Coordination – Orchestration WS-Transactions – Transaction API Impact? Certainly extend it’s usefulness But …..


Download ppt "In Introduction to Web Services"

Similar presentations


Ads by Google