uCosminexus Application Server, Web Service Development Guide

[Contents][Glossary][Index][Back][Next]

34.4 How to add the WS-RM Policy

Enable the WS-RM 1.2 functionality by adding the WS-RM Policy to the WSDL file. The following items are to be added:

  1. Defining the name space prefix to be used in the WS-RM Policy
  2. Defining a policy as the child element of the wsdl:definitions element
  3. Referencing a policy in the child element of the wsdl:binding element

The following example explains how to add these items:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="TestJaxWsService"
  <!--Partially omitted -->
 
<!-- 1. Define the name space prefix to be used in the WS-RM Policy -->
  xmlns:wsp="http://www.w3.org/ns/ws-policy"
  xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702"
  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
  xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl">
 
<!-- 2. Define a policy as the child element of the wsdl:definitions element  -->
 
  <wsp:Policy wsu:Id="WSRM_policy">
    <wsp:ExactlyOne>
      <wsp:All>
        <wsrmp:RMAssertion>
          <wsp:Policy>
            <wsrmp:DeliveryAssurance>
              <wsp:Policy>
                <wsrmp:ExactlyOnce/>
              </wsp:Policy>
            </wsrmp:DeliveryAssurance>
          </wsp:Policy>
        </wsrmp:RMAssertion>
        <wsaw:UsingAddressing/>
        <!- Other settings -->
      </wsp:All>
    </wsp:ExactlyOne>
  </wsp:Policy>
 
  <wsdl:types>
 
<!-- Partially omitted -->
 
<!-- 3. Reference a policy in the child element of the wsdl:binding element -->
  <wsdl:binding name="testJaxWsBinding" type="tns:TestJaxWs">
    <wsp:PolicyReference URI="#WSRM_policy"/>
 
<!-- The rest is omitted -->

The bold values are the definitions or references of the name space prefix definition, WS-RM Policy definition, or WS-RM Policy.

Code the definitions of the WS-RM Policy as a child element of the wsdl:definitions element.

You can omit the elements under the wsrmp:DeliveryAssurance element. Code the elements under the wsrmp:DeliveryAssurance element and those other than "<!--Other settings-->" as is. Add settings for "<!--Other settings-->" as and when required.

For the properties to be added in a WSDL as "<!--Other settings-->", see the section 23.4 Settings by WS-Policy.