WS-Addressing Policy

Overview

Note that policy is required to enable ws-addressing module instances and may be used to constrain their behavior. For more information regarding how policy is used, e.g. how and where it may be attached and the difference between public and private policy, please see the user guide.

Vocabulary

<!--
  W3C XML Schema defined in the Web Services Addressing 1.0 
  - Metadata specification
  http://www.w3.org/TR/ws-addr-metadata
  
  Copyright © 2007 World Wide Web Consortium,
  
  (Massachusetts Institute of Technology, European Research Consortium for
  Informatics and Mathematics, Keio University). All Rights Reserved. This
  work is distributed under the W3C® Software License [1] in the hope that
  it will be useful, but WITHOUT ANY WARRANTY; without even the implied
  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  
  [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.w3.org/2007/02/addressing/metadata" xmlns:wsp="http://www.w3.org/ns/ws-policy" targetNamespace="http://www.w3.org/2007/02/addressing/metadata" blockDefault="#all" elementFormDefault="qualified">
  
  <xs:import namespace="http://www.w3.org/ns/ws-policy" schemaLocation="http.www.w3.org.ns.ws-policy.xsd">
    <xs:annotation>
      <xs:documentation>Note that this import was added to original version of schema by bluestem software to update the wsp namespace.</xs:documentation>
    </xs:annotation>
  </xs:import>

  <xs:element name="ServiceName" type="tns:ServiceNameType" />
  <xs:complexType name="ServiceNameType">
    <xs:simpleContent>
      <xs:extension base="xs:QName">
        <xs:attribute name="EndpointName" type="xs:NCName" use="optional" />
        <xs:anyAttribute namespace="##other" processContents="lax" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:element name="InterfaceName" type="tns:AttributedQNameType" />
  <xs:complexType name="AttributedQNameType">
    <xs:simpleContent>
      <xs:extension base="xs:QName">
        <xs:anyAttribute namespace="##other" processContents="lax" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:attribute name="Action" type="xs:anyURI" />

  <!-- WS-Policy assertions -->

  <xs:element name="Addressing">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="wsp:Policy" />
      </xs:sequence>
      <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>
  </xs:element>

  <xs:element name="AnonymousResponses">
    <xs:complexType>
      <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>
  </xs:element>

  <xs:element name="NonAnonymousResponses">
    <xs:complexType>
      <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>
  </xs:element>

</xs:schema>

Examples

Note that the type of policy used to constrain this feature module is an extension to the core EOA specification. The examples below use policy which complies with version 1.5 of the ws-policy specification.

Public Policy

Public policy is required to enable/constrain ws-addressing module(s) for a specific endpoint. The policy will either indicate that ws-addressing is supported, requires anonymous responses or requires non-anonymous responses as defined within the following example (note that the abstract component definitions have been elided for clarity).

WSDL Descriptions
<deployment xmlns="http://bluestemsoftware.org/specification/eoa/1.0/deployment">
  <components>
    <wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://com.mycompany/eoa/1.0" xmlns:tns="http://com.mycompany/eoa/1.0">
      <wsdl:binding name="myBinding" type="http://www.w3.org/ns/wsdl/soap" xmlns:wsoap="http://www.w3.org/ns/wsdl/soap" wsoap:version="1.1" wsoap:protocol="http://www.w3.org/2006/01/soap11/bindings/HTTP" />
      <wsdl:service name="myService" interface="tns:myInterface">
        <wsdl:endpoint name="myEndpoint" binding="tns:myBinding" address="http://myserver:8080/eoa/ws/myEngine/myService/myEndpoint/">
          <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy">
            <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
              <wsp:Policy>
                <wsam:AnonymousResponses />
              </wsp:Policy>
            </wsam:Addressing>
          </wsp:Policy>
        </wsdl:endpoint>
      </wsdl:service>
      <ext:engine xmlns:ext="http://bluestemsoftware.org/specification/eoa/1.0/component/wsdl/ext" name="myEngine" application="tns:myApplication">
        <ext:actor role="http://some/role" service="tns:myService" />
      </ext:engine>
    </wsdl:description>
    <wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl" targetNamespace="http://com.mycompany/eoa/1.0" xmlns:tns="http://com.mycompany/eoa/1.0">
      <wsdl:binding name="partnerBinding" type="http://www.w3.org/ns/wsdl/soap" xmlns:wsoap="http://www.w3.org/ns/wsdl/soap" wsoap:version="1.1" wsoap:protocol="http://www.w3.org/2006/01/soap11/bindings/HTTP" />
      <wsdl:service name="partnerService" interface="tns:myInterface">
        <wsdl:endpoint name="partnerEndpoint1" binding="tns:partnerBinding" address="http://partnerserver:8080/eoa/ws/partnerEngine/partnerService/partnerEndpoint1/">
          <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy">
            <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
              <wsp:Policy>
                <wsam:NonAnonymousResponses />
              </wsp:Policy>
            </wsam:Addressing>
          </wsp:Policy>
        </wsdl:endpoint>
        <wsdl:endpoint name="partnerEndpoint2" binding="tns:partnerBinding" address="http://partnerserver:8080/eoa/ws/partnerEngine/partnerService/partnerEndpoint2/">
          <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy">
            <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
              <wsp:Policy />
            </wsam:Addressing>
          </wsp:Policy>
        </wsdl:endpoint>
      </wsdl:service>
      <ext:engine xmlns:ext="http://bluestemsoftware.org/specification/eoa/1.0/component/wsdl/ext" name="partnerEngine" application="tns:myApplication">
        <ext:actor role="http://some/role" service="tns:partnerService" />
      </ext:engine>
    </wsdl:description>
  </components>
</deployment>

Within the descriptions above, "myEndpoint" requires anonymous responses, "partnerEndpoint1" requires non-anonymous responses and "partnerEndpoint2" is non-specific regarding anonymous responses.

Private Policy

Note that the following examples use the "default engine" provider to demonstrate private policy attachements. The structure employed by other providers should be similar.

Overriding the Default wsa:ReplyTo Value

If public policy defined on a partner endpoint either requires or supports non-anonymous responses, the ws-addressing module will automatically generate a wsa:ReplyTo address to be sent along with the request when invoking partner endpoint. To override this default behavior, e.g. to specify that a secure endpoint be used instead, requires that private policy be explicitly defined and attached to the element that references partner endpoint. Using the example WSDL description listed above, to define a secure reply to address for requests sent to "partnerEndpoint1" requires the following private policy:

<deployment xmlns="http://bluestemsoftware.org/specification/eoa/1.0/deployment">
  <providers>
    <engine xmlns="http://bluestemsoftware.org/specification/eoa/ext/engine/default/1.0" xmlns:tns="http://com.mycompany/eoa/1.0" name="tns:myEngine">
      <partners>
        <engineReference engineName="tns:partnerEngine">
          <serviceReference serviceName="tns:partnerService">
            <endpointReference endpointName="partnerEndpoint1">
              <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy">
                <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
                  <wsp:Policy xmlns:wsab="http://bluestemsoftware.org/specification/eoa/ext/feature/ws/addressing/policy/1.0">
                    <wsam:NonAnonymousResponses wsab:replyTo="https://myserver:443/eoa/ws/myEngine/partnerEngine/partnerService/partnerEndpoint1/" />
                  </wsp:Policy>
                </wsam:Addressing>
              </wsp:Policy>
            </endpointReference>
          </serviceReference>
        </engineReference>
      </partners>
    </engine>
  </providers>
</deployment>
Forcing Non-specific Policy to Require Anonymous Responses

If public policy defined on a partner endpoint is non specific regarding anonymous responses, the ws-addressing module will, by default, indicate the use of non-anonymous responses within requests sent to partner endpoint. To override this default behavior, e.g. to require that requests sent to "partnerEndpoint2" use anonymous responses requires the following private policy:

<deployment xmlns="http://bluestemsoftware.org/specification/eoa/1.0/deployment">
  <providers>
    <engine xmlns="http://bluestemsoftware.org/specification/eoa/ext/engine/default/1.0" xmlns:tns="http://com.mycompany/eoa/1.0" name="tns:myEngine">
      <partners>
        <engineReference engineName="tns:partnerEngine">
          <serviceReference serviceName="tns:partnerService">
            <endpointReference endpointName="partnerEndpoint2">
              <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy">
                <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
                  <wsp:Policy>
                    <wsam:AnonymousResponses />
                  </wsp:Policy>
                </wsam:Addressing>
              </wsp:Policy>
            </endpointReference>
          </serviceReference>
        </engineReference>
      </partners>
    </engine>
  </providers>
</deployment>