Title: Tiziana'Ferraricnaf'infn'it
1WS-Addressing
- Tiziana.Ferrari_at_cnaf.infn.it
- INFN CNAF
- Corso di Laurea specialistica in Informatica
- Anno Acc. 2004/2005
2Outline
- PART I Uniform Resource Identifier and
WS-Addressing - PART II WS-Addressing Endpoint References
- PART III WS-Addressing Message Header
Information - References
3Uniform 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 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.
4URI, 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.
5URI Examples
- The following examples illustrate URI that are in
common use
6Absolute 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 ltA href"../x"gta hypertext anchorlt/Agt
7URI Syntax
- Absolute URIs are written as follows
- ltschemegtltscheme-specific-partgt
- An absolute URI contains
- the name of the scheme being used (ltschemegt)
followed by a colon ("") and - a string (the ltscheme-specific-partgt) 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 ltschemegt, may be absent
from a particular URI - ltschemegt//ltauthoritygtltpathgt?ltquerygt
- For example, some URI schemes do not allow
an ltauthoritygt component, and others do not use a
ltquerygt 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.
8WS-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.
9WS-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
10PART IIWS-Addressing Endpoint Reference
11Endpoint 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.
12Endpoint XML Representation
- ltwsaEndpointReferencegt
- ltwsaAddressgtxsanyURIlt/wsaAddressgt
- ltwsaReferencePropertiesgt... lt/wsaReferenceProper
tiesgt ? - ltwsaReferenceParametersgt... lt/wsaReferenceParame
tersgt ? - ltwsaPortTypegtxsQNamelt/wsaPortTypegt ?
- ltwsaServiceName PortName"xsNCName"?gtxsQNamelt/w
saServiceNamegt? - ltwspPolicygt ... lt/wspPolicygt
- lt/wsaEndpointReferencegt
- Example
- ltwsaEndpointReference xmlnswsa"..."
xmlnsfabrikam"..."gt ltwsaAddressgthttp//www.fabr
ikam123.example/acctlt/wsaAddressgt
ltwsaPortTypegtfabrikamInventoryPortTypelt/wsaPort
Typegt - lt/wsaEndpointReferencegt
13Endpoint reference components
- address URI (mandatory) An address URI that
identifies the endpoint. This may be a network
address or a logical address. - reference properties xsany (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 xsany (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 wsppolicy (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.
14Binding 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.
15Binding Endpoint Reference Example
- ltwsaEndpointReference xmlnswsa"..."
xmlnsfabrikam"..."gt ltwsaAddressgthttp//www.fabr
ikam123.example/acct - lt/wsaAddressgt
- ltwsaReferencePropertiesgt ltfabrikamCustomerKeygt
123456789lt/fabrikamCustomerKeygt
lt/wsaReferencePropertiesgt - ltwsaReferenceParametersgt ltfabrikamShoppingCart
gtABCDEFGlt/fabrikamShoppingCartgt
lt/wsaReferenceParametersgt lt/wsaEndpointReference
gt - Binding
- ltSEnvelope xmlnsS"http//www.w3.org/2003/05/soa
p-envelope" - xmlnswsa""http//schemas.xmlsoap.org/ws/2004/0
8/addressing" - xmlnsfabrikam"... "gt
- ltSHeadergt
- ...
- ltwsaTogthttp//www.fabrikam123.example/acctlt/wsa
Togt ltfabrikamCustomerKeygt123456789lt/fabrikamCu
stomerKeygt ltfabrikamShoppingCartgtABCDEFGlt/fabrik
amShoppingCartgt - ...
- lt/SHeadergt
- ltSBodygt
- ...
- lt/SBodygt
- lt/SEnvelopegt
()
() during binding, the wsaAddress is copied
into the SOAP destination address, i.e.
wsaTo Note wsa in the SOAP message is related
to a soap- specific namespace.
16Endpoint 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.
17PART III WS-Addressing Message Information Header
18Message 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.
19Message Information Headers (cont)
- action URI (mandatory) An identifier that
uniquely (and opaquely) identifies the semantics
implied 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. wsaReply ? indicates that this is a
reply to the message identified by the URI -
20Message 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 - ltwsaMessageIDgt xsanyURI lt/wsaMessageIDgt
- ltwsaRelatesToRelationshipType"..."?gtxsanyURIlt/
wsaRelatesTogt - ltwsaTogtxsanyURIlt/wsaTogt ltwsaActiongtxsanyURIlt
/wsaActiongt - ltwsaFromgtendpoint-referencelt/wsaFromgt
- ltwsaReplyTogtendpoint-referencelt/wsaReplyTogt
- ltwsaFaultTogtendpoint-referencelt/wsaFaultTogt
21Request Message Using Message Information Header
Block
ltwsaMessageIDgt xsanyURI lt/wsaMessageIDgt
ltwsaRelatesToRelationshipType"..."?gtxsanyURIlt/
wsaRelatesTogt ltwsaTogtxsanyURIlt/wsaTogt
ltwsaActiongtxsanyURIlt/wsaActiongt
ltwsaFromgtendpoint-referencelt/wsaFromgt
ltwsaReplyTogtendpoint-referencelt/wsaReplyTogt ltws
aFaultTogtendpoint-referencelt/wsaFaultTogt
SOAP 1.2 Request message
ltSEnvelope xmlnsS"http//www.w3.org/2003/0
5/soap-envelope" xmlnswsa"http//schemas.xml
soap.org/ws/2004/08/addressing"
xmlnsf123"http//www.fabrikam123.example/svc53"gt
ltSHeadergt ltwsaMessageIDgtuuidaaaabbbb-c
ccc-dddd-eeee-ffffffffffff lt/wsaMessageIDgt
ltwsaReplyTogt ltwsaAddressgthttp//business456
.example/client1lt/wsaAddressgt lt/wsaReplyTogt
ltwsaTo SmustUnderstand"1"gtmailtojoe_at_fabrikam
123.examplelt/wsaTogt ltwsaActiongthttp//fabrikam
123.example/mail/Deletelt/wsaActiongt
lt/SHeadergt ltSBodygt ltf123Deletegt
ltmaxCountgt42lt/maxCountgt lt/f123Deletegt
lt/SBodygt lt/SEnvelopegt
22Reply Message Using Message Information Header
Block
ltSEnvelope xmlnsS"http//www.w3.org/2003/0
5/soap-envelope" xmlnswsa"http//schemas.xml
soap.org/ws/2004/08/addressing"
xmlnsf123"http//www.fabrikam123.example/svc53"gt
ltSHeadergt ltwsaMessageIDgtuuidaaaabbbb-c
ccc-dddd-eeee-ffffffffffff lt/wsaMessageIDgt
ltwsaReplyTogt ltwsaAddressgthttp//business456
.example/client1lt/wsaAddressgt lt/wsaReplyTogt
ltwsaTo SmustUnderstand"1"gtmailtojoe_at_fabrikam
123.examplelt/wsaTogt ltwsaActiongthttp//fabrikam
123.example/mail/Deletelt/wsaActiongt
lt/SHeadergt ltSBodygt ltf123Deletegt
ltmaxCountgt42lt/maxCountgt lt/f123Deletegt
lt/SBodygt lt/SEnvelopegt
SOAP 1.2 Request Message
Different
ltSEnvelope xmlnsS"http//www.w3.org/2003/0
5/soap-envelope" xmlnswsa"http//schemas.xml
soap.org/ws/2004/08/addressing"
xmlnsf123"http//www.fabrikam123.example/svc53"gt
ltSHeadergt ltwsaMessageIDgt
uuidaaaabbbb-cccc-dddd-eeee-wwwwwwwwwwwlt/wsaMess
ageIDgt ltwsaRelatesTogt uuidaaaabbbb-cccc-d
ddd-eeee-fffffffffffflt/wsaRelatesTogt
ltwsaTo SmustUnderstand"1"gthttp//business456.ex
ample/client1lt/wsaTogt ltwsaActiongthttp//fa
brikam123.example/mail/DeleteAcklt/wsaActiongt
lt/SHeadergt ltSBodygt ltf123DeleteAck/gt
lt/SBodygt lt/SEnvelopegt
Identical
SOAP 1.2 Reply Message
Identical
23wsaAction (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 wsaAction
attribute. Example (WSDL excerpt)
ltdefinitions targetNamespace"http//example.com/s
tockquote" ...gt ... ltportType
name"StockQuotePortType"gt ltoperation
name"GetLastTradePrice"gt ltinput
message"tnsGetTradePricesInput"
wsaAction"http//example.com/GetQuote"/gt
ltoutput message"tnsGetTradePricesOutput"
wsaAction"http//example.com/Quote"/gt
lt/operationgt lt/portTypegt ...
lt/definitionsgt
24References
- 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.