1 / 24

WS-Addressing

WS-Addressing. Tiziana.Ferrari@cnaf.infn.it INFN – CNAF Corso di Laurea specialistica in Informatica Anno Acc. 2004/2005. Outline. PART I: Uniform Resource Identifier and WS-Addressing PART II : WS-Addressing Endpoint References PART III : WS-Addressing Message Header Information

Download Presentation

WS-Addressing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. WS-Addressing Tiziana.Ferrari@cnaf.infn.it INFN – CNAF Corso di Laurea specialistica in Informatica Anno Acc. 2004/2005 WS-Addressing

  2. Outline • PART I: Uniform Resource Identifier and WS-Addressing • PART II: WS-Addressing Endpoint References • PART III: WS-Addressing Message Header Information • References WS-Addressing

  3. Uniform Resource Identifier • A Uniform Resource Identifier (URI) is a compact string of characters for identifying an abstract or physical resource. • Uniform: Uniformity provides several benefits: • it allows different types of resource identifiers to be used in the same context, even when the mechanisms used to access those resources may differ; • uniform semantic interpretation of common syntactic conventions across different types of resource identifiers; • introduction of new types of resource identifiers without interfering with the way that existing identifiers are used; • Identifiers can be reused in many different contexts, thus permitting new applications or protocols to leverage a pre-existing, large, and widely-used set of resource identifiers. • Resource:A resource can be anything that has identity (e.g., an electronic document, an image, a service, and a collection of other resources. Not all resources are network"retrievable"; e.g., human beings, corporations, and bound books in a library can also be considered resources. • Identity: The resource is the conceptual mapping to an entity or set ofentities, not necessarily the entity which corresponds to the mapping at any particular instance in time. Thus, a resource can remain constant even when its content---the entities to which it currently corresponds---changes over time. • Identifier: an object that can act as a reference to something that has identity. In the case of URI, the object is a sequence of characters with a restricted syntax. WS-Addressing

  4. URI, URL, URN • A URI can be further classified as a locator, a name, or both: • Uniform Resource Locator (URL) refers to the subset of URI that identify resources via a representation of their primary access mechanism (e.g., their network "location"), rather than identifying the resource by name or by some other attribute(s) of that resource. • Although many URL schemes are named after protocols, this does not imply that the only way to access the URL's resource is via the named protocol. Gateways, proxies, caches, and name resolution services might be used to access some resources, independent of the protocol of their origin, and the resolution of some URL may require the use of more than one protocol (e.g., both DNS and HTTP are typically used to access an "http" URL's resource when it can't be found in a local cache). • Uniform Resource Name (URN) refers to the subset of URI that are required to remain globally unique and persistent even whe the resource ceases to exist or becomes unavailable. WS-Addressing

  5. URI: Examples The following examples illustrate URI that are in common use: WS-Addressing

  6. Absolute vs Relative Identifiers • An absolute identifier refers to a resource independent of thecontext in which the identifier is used. • A relative identifier refers to a resource by describing the difference within a hierarchical namespace between the current context and an absolute identifier of the resource. • Some URI schemes support a hierarchical naming system, where the hierarchy of the name is denoted by a "/" delimiter separating the components in the scheme. • Example: <A href="../x">a hypertext anchor</A> WS-Addressing

  7. URI Syntax • Absolute URIs: are written as follows: <scheme>:<scheme-specific-part> • An absolute URI contains: • the name of the scheme being used (<scheme>) followed by a colon (":") and • a string (the <scheme-specific-part>) whose interpretation depends on the scheme. • The URI syntax does not require that the scheme-specific-part have any general structure or set of semantics which is common among all URI. • A subset of URI do share a common syntax for representing hierarchical relationships within the namespace. This "generic URI" syntax consists of a sequence of four main components, each of which, except <scheme>, may be absent from a particular URI: <scheme>://<authority><path>?<query> For example, some URI schemes do not allow an <authority> component, and others do not use a <query> component. absoluteURI = scheme ":" ( hier_part | opaque_part ) • Relative URIs: the syntax for relative URI is a shortened form of that for absolute URI, where some prefix of the URI is missing and certain path components ("." and "..") have a special meaning when, and only when, interpreting a relative path. WS-Addressing

  8. WS-Addressing • Using today's approach, the source and destination information are not part of the message itself. This can cause several problems. The information can be lost if a transport connection terminates (for example, if the response takes a long time and the connection times out) or if the message is forwarded by an intermediary such as a firewall. • WS-Addressing provides a mechanism to place the target, source and other important address information directly within the Web service message. In short, WS-Addressing decouples address information from any specific transport model. • In many scenarios messages are targeted directly to a service and the addressing information in the message can be described simply using a URL. But in practice, we often find that messages are targeted to specific elements or resources within a service. For example, a coordination service might be coordinating many different tasks. The coordinator needs to associate most incoming messages with a specific task instance that it manages and not the coordination service itself.  • WS-Addressing provides a simple yet powerful mechanism called an endpoint reference for addressing entities managed by a service. While such information could be encoded in an ad-hoc manner within the URL of the service, the endpoint references provides a standard XML element that enables a structured approach to encoding this fine-grained addressing. WS-Addressing

  9. WS-Addressing (cont) • WS-Addressing provides transport and application-neutral mechanisms to address Web services and messages. • It enables messaging systems to support message transmission through networks that include processing nodes such as endpoint managers, firewalls, and gateways in a transport-neutral manner. • Web Services Addressing (WS-Addressing) defines two interoperable constructs that convey information that is typically provided by transport protocols and messaging systems: endpoint references and message information headers. • Endpoint references convey the information needed • to identify a Web service endpoint: to provide addresses for individual messages sent to and from Web services; • Message information headers: • to convey end-to-end message characteristics including: • addressing for source and destination endpoints • Message identity WS-Addressing

  10. PART IIWS-Addressing: Endpoint Reference WS-Addressing

  11. Endpoint reference and message information headers • Web service endpoint: a (referenceable) entity, processor, or resource where Web service messages can be targeted. Endpoint references convey the information needed to identify/reference a Web service endpoint, and may be used in several different ways: • used to provide addresses for individual messages sent to and from Web services; • to convey the information needed to access a Web service endpoint. • To deal with this last usage case this specification defines a family of message information headers that allows uniform addressing of messages independent of underlying transport. These message information headers convey end-to-end message characteristics including addressing for source and destination endpoints as well as message identity. WS-Addressing

  12. Endpoint XML Representation <wsa:EndpointReference> <wsa:Address>xs:anyURI</wsa:Address> <wsa:ReferenceProperties>... </wsa:ReferenceProperties> ? <wsa:ReferenceParameters>... </wsa:ReferenceParameters> ? <wsa:PortType>xs:QName</wsa:PortType> ? <wsa:ServiceName PortName="xs:NCName"?>xs:QName</wsa:ServiceName>? <wsp:Policy> ... </wsp:Policy>* </wsa:EndpointReference> Example: <wsa:EndpointReference xmlns:wsa="..." xmlns:fabrikam="..."> <wsa:Address>http://www.fabrikam123.example/acct</wsa:Address> <wsa:PortType>fabrikam:InventoryPortType</wsa:PortType> </wsa:EndpointReference> WS-Addressing

  13. Endpoint reference components • [address] : URI (mandatory) An address URI that identifies the endpoint. This may be a network address or a logical address. • [reference properties] : xs:any (0..unbounded). A reference may contain a number of individual properties that are required to identify the entity or resource being conveyed. Reference identification properties are element information items that are named by QName and are required to properly dispatch messages to endpoints at the endpoint side of the interaction. Reference properties are provided by the issuer of the endpoint reference and are otherwise assumed to be opaque to consuming applications. • [reference parameters] : xs:any (0..unbounded). Individual parameters are associated with the endpoint to facilitate a particular interaction. Reference parameters are element information items that are named by QName and are required to properly interact with the endpoint. Reference parameters are also provided by the issuer of the endpoint reference and are otherwise assumed to be opaque to consuming applications. • [selected port type] : QName (0..1) The QName of the primary portType of the endpoint being conveyed. • [service-port] : (QName, NCName (0..1)) (0..1) the QName identifying the WSDL service element that contains the definition of the endpoint being conveyed. The service name provides a link to a full description of the service endpoint. An optional non-qualified name identifies the specific port in the service that corresponds to the endpoint. • [policy] : wsp:policy (0..unbounded) A variable number of XML policy elements as described in WS-Policy describing the behavior, requirements and capabilities of the endpoint. Policies may be included in an endpoint to facilitate easier processing by the consuming application, or because the policy was dynamically generated. However, embedded policies are not authoritative and may be stale or incoherent with the policies associated with the endpoint at the time when the interaction occurs. WS-Addressing

  14. Binding Endpoint Reference • Information contained in the endpoint reference is mapped to the message and protocol fields according to a transformation that is dependent on the protocol and data representation used to send the message. • The specification defines the SOAP binding for endpoint references. There are two rules: • The [address] property in the endpoint reference is copied in the [destination] header field of the SOAP message. • Each [reference property] and [reference parameter] element becomes a header block in the SOAP message. The element information item of each [reference property] or [reference parameter] (including all of its [children], [attributes] and [in-scope namespaces]) is to be added as a header block in the new message. WS-Addressing

  15. Binding Endpoint Reference: Example <wsa:EndpointReference xmlns:wsa="..." xmlns:fabrikam="..."> <wsa:Address>http://www.fabrikam123.example/acct </wsa:Address> <wsa:ReferenceProperties> <fabrikam:CustomerKey>123456789</fabrikam:CustomerKey> </wsa:ReferenceProperties> <wsa:ReferenceParameters> <fabrikam:ShoppingCart>ABCDEFG</fabrikam:ShoppingCart> </wsa:ReferenceParameters> </wsa:EndpointReference> Binding: <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:fabrikam="... "> <S:Header> ... <wsa:To>http://www.fabrikam123.example/acct</wsa:To><fabrikam:CustomerKey>123456789</fabrikam:CustomerKey><fabrikam:ShoppingCart>ABCDEFG</fabrikam:ShoppingCart> ... </S:Header> <S:Body> ... </S:Body> </S:Envelope> (*) (*) during binding, the wsa:Address is copied into the SOAP destination address, i.e. wsa:To Note: wsa in the SOAP message is related to a soap- specific namespace. WS-Addressing

  16. Endpoint Reference Comparison • The relation between the behaviors of the endpoints represented by two endpoint references with the same address and the same reference properties. • The two endpoints accept the same sets of messages. • They follow and require the same set of policies. That is, the XML Schema, WSDL, and WS-Policy metadata applicable to the two references are the same. In particular, the policies applicable to the two endpoints are the same regardless of the values of the embedded [policy]. Embedded policies are not authoritative and may be stale or incoherent with the policies associated with the endpoint. • The [address] properties of two endpoint references are compared according to Section 6 of [RFC 2396]. The reference properties of two endpoint references are equal if: • they contain the same number of individual properties; • for each reference property in one endpoint reference there exists an equivalent reference property in the other. WS-Addressing

  17. PART III WS-Addressing Message Information Header WS-Addressing

  18. Message Information Headers The message information headers collectively augment a message with a set of abstract properties. These properties enable the 1. identification and 2. location of the endpoints involved in an interaction (one-way, request/response). [destination] : URI (mandatory) The address of the intended receiver of this message. [source endpoint] : endpoint reference (0..1) endpoint where the message originated from. [reply endpoint] : endpoint reference (0..1) identifies the intended receiver for replies to this message. If a reply is expected, a message MUST contain a [reply endpoint]. If the [reply endpoint] is absent, the contents of the [source endpoint] may be used to formulate a message to the source. This property MAY be absent if the message has no meaningful reply. If this property is present, the [message id] property is REQUIRED. [fault endpoint] : endpoint reference (0..1) identifies the intended receiver for faults related to this message. If the [fault endpoint] is absent, the sender MAY use the contents of the [reply endpoint] to formulate the fault message. If both the [fault endpoint] and [reply endpoint] are absent, the sender MAY use the contents of the [source endpoint] to formulate the fault message. If this property is present, the [message id] property is REQUIRED. WS-Addressing

  19. Message Information Headers (cont) [action] : URI (mandatory) An identifier that uniquely (and opaquely)identifies the semanticsimplied by this message. It is RECOMMENDED that value of the [action] property is a URI identifying an input, output, or fault message within a WSDL port type. An action may be explicitly or implicitly associated with the corresponding WSDL definition. Finally, if in addition to the [action] property, a SOAP Action URI is encoded in a request, the URI of the SOAP Action MUST be the same as the one specified by the [action] property. [message id] : URI (0..1) A URI that uniquely identifies this message in time and space. Two messages with a distinct application intent cannot share a [message id] property. A message MAY be retransmitted for any purpose including communications failure and MAY use the same [message id] property. The value of this property is an opaque URI whose interpretation beyond equivalence is not defined in this specification. If a reply is expected, this property MUST be present. [relationship] : (QName, URI) (0..unbounded) A pair of values that indicate how this message relates to another message. The type of the relationship is identified by a QName. The related message is identified by a URI that corresponds to the related message's [message id] property. E.g. wsa:Reply indicates that this is a reply to the message identified by the URI WS-Addressing

  20. Message Information Headers • The information in these headers is immutable and not intended to be modified along the message path. • The following describes the contents of the message information header blocks: <wsa:MessageID> xs:anyURI </wsa:MessageID> <wsa:RelatesToRelationshipType="..."?>xs:anyURI</wsa:RelatesTo> <wsa:To>xs:anyURI</wsa:To> <wsa:Action>xs:anyURI</wsa:Action> <wsa:From>endpoint-reference</wsa:From> <wsa:ReplyTo>endpoint-reference</wsa:ReplyTo> <wsa:FaultTo>endpoint-reference</wsa:FaultTo> WS-Addressing

  21. Request Message Using Message Information Header Block <wsa:MessageID> xs:anyURI </wsa:MessageID> <wsa:RelatesToRelationshipType="..."?>xs:anyURI</wsa:RelatesTo> <wsa:To>xs:anyURI</wsa:To> <wsa:Action>xs:anyURI</wsa:Action> <wsa:From>endpoint-reference</wsa:From> <wsa:ReplyTo>endpoint-reference</wsa:ReplyTo> <wsa:FaultTo>endpoint-reference</wsa:FaultTo> SOAP 1.2 Request message: <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:f123="http://www.fabrikam123.example/svc53"> <S:Header> <wsa:MessageID>uuid:aaaabbbb-cccc-dddd-eeee-ffffffffffff </wsa:MessageID> <wsa:ReplyTo> <wsa:Address>http://business456.example/client1</wsa:Address> </wsa:ReplyTo> <wsa:To S:mustUnderstand="1">mailto:joe@fabrikam123.example</wsa:To> <wsa:Action>http://fabrikam123.example/mail/Delete</wsa:Action> </S:Header> <S:Body> <f123:Delete> <maxCount>42</maxCount> </f123:Delete> </S:Body> </S:Envelope> WS-Addressing

  22. Reply Message Using Message Information Header Block <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:f123="http://www.fabrikam123.example/svc53"> <S:Header> <wsa:MessageID>uuid:aaaabbbb-cccc-dddd-eeee-ffffffffffff </wsa:MessageID> <wsa:ReplyTo> <wsa:Address>http://business456.example/client1</wsa:Address> </wsa:ReplyTo> <wsa:To S:mustUnderstand="1">mailto:joe@fabrikam123.example</wsa:To> <wsa:Action>http://fabrikam123.example/mail/Delete</wsa:Action> </S:Header> <S:Body> <f123:Delete> <maxCount>42</maxCount> </f123:Delete> </S:Body> </S:Envelope> SOAP 1.2 Request Message Different <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:f123="http://www.fabrikam123.example/svc53"> <S:Header> <wsa:MessageID> uuid:aaaabbbb-cccc-dddd-eeee-wwwwwwwwwww</wsa:MessageID> <wsa:RelatesTo> uuid:aaaabbbb-cccc-dddd-eeee-ffffffffffff</wsa:RelatesTo> <wsa:To S:mustUnderstand="1">http://business456.example/client1</wsa:To> <wsa:Action>http://fabrikam123.example/mail/DeleteAck</wsa:Action> </S:Header> <S:Body> <f123:DeleteAck/> </S:Body> </S:Envelope> Identical SOAP 1.2 Reply Message: Identical WS-Addressing

  23. wsa:Action (Explicit association with WSDL operations) • The action element, which is included in the SOAP header, can be explicitly associated to a message in a WSDL document, through the wsa:Action attribute. Example (WSDL excerpt): <definitions targetNamespace="http://example.com/stockquote" ...> ... <portType name="StockQuotePortType"> <operation name="GetLastTradePrice"> <input message="tns:GetTradePricesInput" wsa:Action="http://example.com/GetQuote"/> <output message="tns:GetTradePricesOutput" wsa:Action="http://example.com/Quote"/> </operation> </portType> ... </definitions> WS-Addressing

  24. References • Web Services Addressing (WS-Addressing), A.Bosworth, D.Box, E.Christensen, et alt.; March 2004. • Uniform Resource Identifiers (URI): Generic Syntax; RFC 2396, August 1998. WS-Addressing

More Related