Published on

Published in: Technology, Education
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 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. 2. WS-* family of complementary Web servicetechnologies in this lecture W3C Web Services Addressing Working Group:• WS-AddressingSummer 2013
  3. 3. WS-Addressing W3C Web Services Addressing Working Group completed and closed on 5 Sep 2007 motivation standard way to include information aboutmessage sender and receiver, how to returnmessage response in message itselfSummer 2013
  4. 4. WS-Addressing consists of three W3C recommendations WS Addressing 1.0 – Core• endpoint references and message addressing properties• namespace URI (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 URI prefix wsam)Summer 2013
  5. 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. 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=""></wsa:EndpointReference>
  7. 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. 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. 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. 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. 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 namespace• URI where WSDL description is locatedSummer 2013
  12. 12. Endpoint ReferencesSummer 2013<wsa:EndpointReference><wsa:Metadataxmlns:wsdli=""xmlns:tsi=""wsdli:wsdlLocation=""><wsam:InterfaceName>tsi:TripleStoreWSPortType</wsam:InterfaceName><wsam:ServiceName EndpointName="tsi:TripleStoreWS">tsi:TripleStore</wsam:ServiceName></wsa:Metadata></wsa:EndpointReference>
  13. 13. Message Addressing Properties part of message in case of SOAP = SOAP headersSummer 2013
  14. 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. 15. Message Addressing PropertiesSummer 2013<soap:Envelopexmlns:soap=""xmlns:wsa=""xmlns:auc=""><soap:Header><wsa:To>http://gd/Entity/services/PublicContract</wsa:To><wsa:ReplyTo><wsa:Address></wsa:Address><wsa:ReferenceParameters><auc:number>2011107152334-0322</auc:number></wsa:ReferenceParameters></wsa:ReplyTo></soap:Header></soap:Envelope>
  16. 16. Message Addressing PropertiesSummer 2013<soap:Envelopexmlns:soap=""xmlns:wsa=""xmlns:auc=""><soap:Header><auc:number>2011107152334-0322</auc:number></soap:Header></soap:Envelope>
  17. 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. 18. Message Addressing PropertiesSummer 2013<soap:Envelope xmlns:soap="..." xmlns:wsa="..."><soap:Header><wsa:Action></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="" /><wsdl:output message="srv:GetPublicContractResponse"wsaw:Action="" /></wsdl:operation></wsdl:portType></wsdl:definitions>
  19. 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 value 2013
  20. 20. Message Addressing PropertiesSummer 2013<soap:Envelope xmlns:soap="..." xmlns:wsa="..."><soap:Header><wsa:Action></wsa:Action><wsa:MessageID></wsa:MessageID></soap:Header></soap:Envelope><soap:Envelope xmlns:soap="..." xmlns:wsa="..."><soap:Header><wsa:Action></wsa:Action><wsa:RelatesTo></wsa:RelatesTo></soap:Header></soap:Envelope>
  21. 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=""><wsa:Address>http://gd/EntityServices/services/PublicContractWS</wsa:Address></wsa:EndpointReference></wsdl:port>Summer 2013
  22. 22. More on Extending WSDLwsdl11:portsoap:addresswsa:EndpointReferencewsa:Addresswsa:ReferenceParameterssoap:Headerwsa:Tons1:param1ns2:param2ns1:param1ns2:param2Summer 2013
  23. 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. 24. wsdl11:bindingMore on Extending WSDLwsdl11:portTypewsdl11:operationsoap:Headerwsa:Actionwsdl11:inputwsaw:Action12wsdl11:operationsoap:operation@soapActionSummer 2013
  25. 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. 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] 2013