uCosminexus Application Server, Web Service Development Guide

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

35.3.2 Adding the WS-RM Policy in the WSDL file

Add the WS-RM Policy in the newly added WSDL file. The following are the items to be added:

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

The following is an example for adding the policy:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="TestJaxWsService"
 
<!-- omitted -->
 
<!-- 1.Defining the name space prefix to be used with 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.Defining the 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:RMAssertion>
        <wsaw:UsingAddressing/>
      </wsp:All>
    </wsp:ExactlyOne>
  </wsp:Policy>
 
  <wsdl:types>
 
<!-- omitted -->
 
<!-- 3.Referencing the policy with the child element of the wsdl:binding element -->
  <wsdl:binding name="testJaxWsBinding" type="tns:TestJaxWs">
    <wsp:PolicyReference URI="#WSRM_policy"/>
    <!-- document/literal/wrapped -->
 
<!-- rest is omitted -->