Your SlideShare is downloading. ×
WS-Addressing
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

WS-Addressing

592
views

Published on

Published in: Technology, Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
592
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Web Services (NSWI145)Lecture 08: WS Addressing, WS NotificationMartin Nečaský, Ph.D.Faculty of Mathematics and PhysicsCharles University in Prague, Czech RepublicSummer 2013
  • 2. WS-* family of complementary Web servicetechnologies in this lecture W3C Web Services Addressing Working Group:• WS-AddressingSummer 2013
  • 3. WS-Addressing W3C Web Services Addressing Working Group completed and closed on 5 Sep 2007 http://www.w3.org/2002/ws/addr/ motivation standard way to include information aboutmessage sender and receiver, how to returnmessage response in message itselfSummer 2013
  • 4. WS-Addressing consists of three W3C recommendations WS Addressing 1.0 – Core• endpoint references and message addressing properties• namespace URIhttp://www.w3.org/2005/08/addressing (usualprefix wsa) WS Addressing 1.0 – SOAP Binding WS Addressing 1.0 – Metadata• binding endpoint references to WSDL metadata• how message addressing properties are described using WSDL• how WS-Policy can be used to indicate support for WS-Addressing• namespace URIhttp://www.w3.org/2007/05/addressing/metadata(usual prefix wsam)Summer 2013
  • 5. Endpoint References informally endpoint is a referable entity, process or resource towhich messages can be addressed endpoint reference provides information needed toaddress endpoint can be part of service interface description or createddynamically (e.g. in SOAP messages, BPEL scripts, ...) formally endpoint is a collection of abstract properties WS-Addressing defines a core set of properties whichcan be extended by other specificationsSummer 2013
  • 6. Endpoint ReferencesSummer 2013 element wsa:EndpointReference defines endpoint reference can be used by any other WS standard• WS-Addressing Core does not specify where elementcan be used• used, e.g., in BPEL 2.0<wsa:EndpointReferencexmlns:wsa="http://www.w3.org/2005/08/addressing"></wsa:EndpointReference>
  • 7. Endpoint ReferencesSummer 2013 complex typewsa:EndpointReferenceType type of wsa:EndpointReference can be used by any other WS standard• used, e.g., in SOAP headers sequence of elements• wsa:Address• wsa:ReferenceParameters• wsa:Metadata
  • 8. Endpoint ReferencesSummer 2013 element wsa:Address required absolute IRI representing endpoint address two predefined values• wsa:anonymous : for endpoints without address• wsa:none : for endpoints which discard messages<wsa:EndpointReference><wsa:Address>http://gd/TripleStore/services/TripleStoreWS</wsa:Address></wsa:EndpointReference>
  • 9. Endpoint ReferencesSummer 2013 element wsa:ReferenceParameters optional list of individual parameters associated with endpointrequired to properly interact with endpoint• they are not ordered• in case of SOAP as transfer protocol, they determine headersrequired by endpoint<wsa:EndpointReference><wsa:ReferenceParameters>...</wsa:ReferenceParameters></wsa:EndpointReference>
  • 10. Endpoint ReferencesSummer 2013 element wsa:Metadata optional list of meta-properties which describe endpointbehavior, policies and capabilities not necessarily full list of all endpoint metadata<wsa:EndpointReference><wsa:Metadata>...</wsa:Metadata></wsa:EndpointReference>
  • 11. Endpoint References WS Addressing Metadata introduces specificmeta-properties which specify binding to WSDL element wsam:InterfaceName• WSDL2.0 interface name or WSDL1.1 port type name element wsam:ServiceName• WSDL2.0 service name or WSDL1.1 service name• attribute EndpointName– WSDL2.0 endpoint name or WSDL1.1 port name it is possible to use WSDL2.0 attributewsdlLocation of wsa:Metadata element• from http://www.w3.org/ns/wsdl-instance namespace• URI where WSDL description is locatedSummer 2013
  • 12. Endpoint ReferencesSummer 2013<wsa:EndpointReference><wsa:Metadataxmlns:wsdli="http://www.w3.org/ns/wsdl-instance"xmlns:tsi="http://opendata.cz/Infrastructure/TripleStore/iface#"wsdli:wsdlLocation="http://opendata.cz/Infrastructure/TripleStore/iface#http://gd/TripleStore/services/TripleStoreWS?wsdl"><wsam:InterfaceName>tsi:TripleStoreWSPortType</wsam:InterfaceName><wsam:ServiceName EndpointName="tsi:TripleStoreWS">tsi:TripleStore</wsam:ServiceName></wsa:Metadata></wsa:EndpointReference>
  • 13. Message Addressing Properties part of message in case of SOAP = SOAP headersSummer 2013
  • 14. Message Addressing Properties element wsa:To optional value is xs:anyURI absolute URI representing address of intended message receiver element wsa:From optional value wsa:EndpointReferenceType endpoint from which message originated element wsa:ReplyTo optional value wsa:EndpointReferenceType endpoint for intended receiver of replies to this message element wsa:FaultTo optional value wsa:EndpointReferenceType endpoint for intended receiver of faults related to this messageSummer 2013
  • 15. Message Addressing PropertiesSummer 2013<soap:Envelopexmlns:soap="http://www.w3.org/2003/05/soap-envelope"xmlns:wsa="http://www.w3.org/2005/08/addressing"xmlns:auc="http://example.org/auction"><soap:Header><wsa:To>http://gd/Entity/services/PublicContract</wsa:To><wsa:ReplyTo><wsa:Address>http://example.org/auction/replyConsumer</wsa:Address><wsa:ReferenceParameters><auc:number>2011107152334-0322</auc:number></wsa:ReferenceParameters></wsa:ReplyTo></soap:Header></soap:Envelope>
  • 16. Message Addressing PropertiesSummer 2013<soap:Envelopexmlns:soap="http://www.w3.org/2003/05/soap-envelope"xmlns:wsa="http://www.w3.org/2005/08/addressing"xmlns:auc="http://example.org/auction"><soap:Header><auc:number>2011107152334-0322</auc:number></soap:Header></soap:Envelope>
  • 17. Message Addressing Properties element wsa:Action mandatory value is xs:anyURI absolute URI uniquely identifying semantics implied bymessage URI should identify input, output or fault message withinWSDL 1.1 port type or WSDL 2.0 interface• identification assigned to message withwsaw:Action attribute of wsdl:input,wsdl:output or wsdl:fault elements• wsaw:Action introduced in WS Addressing 1.0MetadataSummer 2013
  • 18. Message Addressing PropertiesSummer 2013<soap:Envelope xmlns:soap="..." xmlns:wsa="..."><soap:Header><wsa:Action>http://opendata.cz/.../iface#opGetPublicContract</wsa:Action></soap:Header></soap:Envelope><wsdl:definitions xmlns:wsdl="..." xmlns:wsa="..." srv="..."><wsdl:portType name="PublicContractPortType"><wsdl:operation name="GetPublicContractRDF"><wsdl:input message="srv:GetPublicContractRequest"wsaw:Action="http://opendata.cz/.../iface#opGetPublicContract" /><wsdl:output message="srv:GetPublicContractResponse"wsaw:Action="http://opendata.cz/.../iface#opGetPublicContractResp" /></wsdl:operation></wsdl:portType></wsdl:definitions>
  • 19. Message Addressing Properties element wsa:MessageID optional value is xs:anyURI absolute IRI uniquely identifying message uniqueness is responsibility of sender, receiver’s behavior incase of duplicated IDs is not specified element wsa:RelatesTo optional value is xs:anyURI ID of a message related to this message relationship type specified by attribute RelationshipType• default valuehttp://www.w3.org/2005/08/addressing/replySummer 2013
  • 20. Message Addressing PropertiesSummer 2013<soap:Envelope xmlns:soap="..." xmlns:wsa="..."><soap:Header><wsa:Action>http://opendata.cz/.../iface#opGetPublicContract</wsa:Action><wsa:MessageID>http://example.org/contract_bidder/BID2011107152334-0322</wsa:MessageID></soap:Header></soap:Envelope><soap:Envelope xmlns:soap="..." xmlns:wsa="..."><soap:Header><wsa:Action>http://opendata.cz/.../iface#opGetPublicContractResp</wsa:Action><wsa:RelatesTo>http://example.org/contract_bidder/BID2011107152334-0322</wsa:RelatesTo></soap:Header></soap:Envelope>
  • 21. More on Extending WSDL WSDL 2.0 endpoint or WSDL 1.1 port may beextended with WS addressing endpoint reference<wsdl:port name="PublicContractWS" binding="srv:PublicContractSOAPBinding"><soap:addresslocation="http://gd/EntityServices/services/PublicContractWS" /><wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Address>http://gd/EntityServices/services/PublicContractWS</wsa:Address></wsa:EndpointReference></wsdl:port>Summer 2013
  • 22. More on Extending WSDLwsdl11:portsoap:addresswsa:EndpointReferencewsa:Addresswsa:ReferenceParameterssoap:Headerwsa:Tons1:param1ns2:param2ns1:param1ns2:param2Summer 2013
  • 23. More on Extending WSDL wsa:Action in incoming message associated withinput, output or fault within WSDL description two association mechanisms explicit association• action is defined explicitly for input, output or fault messages withwsaw:Action attribute (we have already seen sample SOAPmessage and WSDL description on previous slides)• if wsaw:Action attribute is missing– if soap:operation/@soapAction attribute with a non-empty values ispresent then its value is action for input message– if soap:operation/@soapAction attribute is missing or empty valuethen action for input message is assigned implicitly implicit association is defined for WSDL 1.1 and WSDL 2.0Summer 2013
  • 24. wsdl11:bindingMore on Extending WSDLwsdl11:portTypewsdl11:operationsoap:Headerwsa:Actionwsdl11:inputwsaw:Action12wsdl11:operationsoap:operation@soapActionSummer 2013
  • 25. More on Extending WSDL implicit association for WSDL 1.1 so called Default Action Pattern for WSDL 1.1 pattern for input and output messages[target namespace][delimiter][port type name][delimiter][input|output name] pattern for fault messages[target namespace][delimiter][port type name][delimiter][operation name][delimiter]Fault[delimiter][fault name] [delimiter]is : (for URN target namespace) or /Summer 2013
  • 26. More on Extending WSDL<wsdl:portType name="PublicContractPortType"><wsdl:operation name="GetPublicContract"><wsdl:input message="srv:GetPublicContractRequest"name="GetPublicContract" /><wsdl:output message="srv:GetPublicContractResponse"name="PublicContract" /></wsdl:operation></wsdl:portType>[target namespace][delimiter][port type name][delimiter][input|output name]http://opendata.cz/EntityServices/PublicContract/iface/PublicContractPortType/GetPublicContracthttp://opendata.cz/EntityServices/PublicContract/iface/PublicContractPortType/PublicContractSummer 2013