Documente Academic
Documente Profesional
Documente Cultură
Tiziana.Ferrari@cnaf.infn.it INFN CNAF Corso di Laurea specialistica in Informatica Anno Acc. 2004/2005
Griglie Computazionali
WS-Addressing
Outline
PART I: Uniform Resource Identifier and WSAddressing PART II: WS-Addressing Endpoint References PART III: WS-Addressing Message Header Information References
Griglie Computazionali
WS-Addressing
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 of entities, 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.
Griglie Computazionali WS-Addressing 3
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.
Griglie Computazionali
WS-Addressing
URI: Examples
The following examples illustrate URI that are in common use: ftp://ftp.is.co.za/rfc/rfc1808.txt ftp scheme for File Transfer Protocol services http scheme for Hypertext Transfer Protocol services mailto scheme for electronic mail addresses telnet scheme for interactive services via the TELNET Protocol
telnet://melvyl.ucop.edu/
Griglie Computazionali
WS-Addressing
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 7
Griglie Computazionali
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.
Griglie Computazionali
WS-Addressing
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;
Griglie Computazionali
WS-Addressing
Griglie Computazionali
WS-Addressing
10
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.
Griglie Computazionali
WS-Addressing
11
</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>
Griglie Computazionali
WS-Addressing
12
Griglie Computazionali
Griglie Computazionali
WS-Addressing
14
<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> (*) during binding, the wsa:Address is copied into the ... SOAP destination address, i.e. wsa:To </S:Body> Note: wsa in the SOAP message is related to a soap</S:Envelope>
specific namespace.
Griglie Computazionali WS-Addressing 15
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.
Griglie Computazionali WS-Addressing 16
Griglie Computazionali
WS-Addressing
17
Griglie Computazionali
WS-Addressing
19
Griglie Computazionali
WS-Addressing
20
Griglie Computazionali
WS-Addressing
21
Different
Identical
<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
Griglie Computazionali
WS-Addressing
22
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>
Griglie Computazionali
WS-Addressing
23
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.
Griglie Computazionali
WS-Addressing
24