Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4065

Policy attached to an input operation in a WSDL does not get copied to the Stub operation by WSDL2Java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.4.1
    • None
    • codegen
    • None
    • java 1.5, mac os 1.4, rampart 1.4

    Description

      I am using ws-policy elements attached to a manually created WSDL to describe message security. I am using WSDL2Java to create a client and server stubs for the service. Policy that is attached at the binding element gets passed by the client stub code to the operation, but policy that is attached to the message at wsdl:binding/wsdl:operation/wsdl:input does not.
      I followed http://www.w3.org/Submission/WS-PolicyAttachment/ in deciding where to place the message specific policy. I tried doing it by reference and by PolicyAttachement, but neither worked for me either.

      The wsdl is as follows:

      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions name="OSCARS"
      targetNamespace="http://oscars.es.net/OSCARS"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/"
      xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
      xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
      xmlns:tns="http://oscars.es.net/OSCARS">

      <wsdl:documentation>
      This is WSDL for the OSCARS public reservation interface. These
      messages must be signed using the following WS-secuirty
      standards. The message is time stamped and includes the X.509
      certificate of the signing entity. The timestamp, certificate
      and message body are all signed. DRAFT V1.0 Nov 2006
      </wsdl:documentation>

      <!-- Element definitons -->
      <wsdl:types>
      <xsd:schema targetNamespace="http://oscars.es.net/OSCARS"
      elementFormDefault="qualified"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:tns="http://oscars.es.net/OSCARS">
      <xsd:include schemaLocation="OSCARS.xsd" />
      </xsd:schema>
      <xsd:schema>
      <xsd:import
      namespace="http://docs.oasis-open.org/wsn/b-2"
      schemaLocation="b-2-idc.xsd"/>
      </xsd:schema>
      <xsd:schema>
      <xsd:import
      namespace="http://docs.oasis-open.org/wsrf/r-2"
      schemaLocation="r-2-idc.xsd"/>
      </xsd:schema>
      </wsdl:types>

      <!-- Message definitions -->

      <wsdl:message name="createReservation">
      <wsdl:part name="createReservation"
      element="tns:createReservation">
      </wsdl:part>
      </wsdl:message>
      <wsdl:message name="createReservationResponse">
      <wsdl:part name="createReservationResponse"
      element="tns:createReservationResponse" />
      </wsdl:message>

      <wsdl:message name="queryReservation">
      <wsdl:part name="queryReservation"
      element="tns:queryReservation" />
      </wsdl:message>
      <wsdl:message name="queryReservationResponse">
      <wsdl:part name="queryReservationResponse"
      element="tns:queryReservationResponse" />
      </wsdl:message>

      <wsdl:message name="Notify">
      <wsdl:part name="Notify" element="wsnt:Notify"/>
      </wsdl:message>

      <wsdl:message name="AAAFaultMessage">
      <wsdl:part name="fault" element="tns:AAAFault" />
      </wsdl:message>

      <wsdl:message name="BSSFaultMessage">
      <wsdl:part name="fault" element="tns:BSSFault" />
      </wsdl:message>

      <wsdl:portType name="OSCARS">
      <wsdl:operation name="createReservation">
      <wsdl:input message="tns:createReservation" />
      <wsdl:output message="tns:createReservationResponse" />
      <wsdl:fault name="AAAErrorException"
      message="tns:AAAFaultMessage" />
      <wsdl:fault name="BSSErrorException"
      message="tns:BSSFaultMessage" />
      </wsdl:operation>

      <wsdl:operation name="queryReservation">
      <wsdl:input message="tns:queryReservation" />
      <wsdl:output message="tns:queryReservationResponse" />
      <wsdl:fault name="AAAErrorException"
      message="tns:AAAFaultMessage" />
      <wsdl:fault name="BSSErrorException"
      message="tns:BSSFaultMessage" />
      </wsdl:operation>

      <wsdl:operation name="Notify">
      <wsdl:input message="tns:Notify" />
      </wsdl:operation>

      </wsdl:portType>

      <wsdl:binding name="OSCARSSOAP" type="tns:OSCARS">
      <!-- <wsp:PolicyReference URI="#X509EndpointPolicy" wsdl:required="true" /> -->
      <wsp:Policy xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
      xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
      xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
      wsu:Id="X509EndPointPolicy">
      <wsp:ExactlyOne>
      <wsp:All>
      <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
      <wsp:Policy>
      <sp:InitiatorToken>
      <wsp:Policy>
      <sp:X509Token
      sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
      <wsp:Policy>
      <sp:WssX509V3Token10 />
      </wsp:Policy>
      </sp:X509Token>
      </wsp:Policy>
      </sp:InitiatorToken>
      <sp:RecipientToken>
      <wsp:Policy>
      <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
      <wsp:Policy>
      <sp:WssX509V3Token10 />
      </wsp:Policy>
      </sp:X509Token>
      </wsp:Policy>
      </sp:RecipientToken>
      <sp:AlgorithmSuite>
      <wsp:Policy>
      <sp:TripleDesRsa15 />
      </wsp:Policy>
      </sp:AlgorithmSuite>
      <sp:Layout>
      <wsp:Policy>
      <sp:Strict />
      </wsp:Policy>
      </sp:Layout>
      <sp:IncludeTimestamp />
      <sp:OnlySignEntireHeadersAndBody />
      </wsp:Policy>
      </sp:AsymmetricBinding>
      <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
      <wsp:Policy>
      <sp:MustSupportRefKeyIdentifier />
      <sp:MustSupportRefIssuerSerial />
      </wsp:Policy>
      </sp:Wss10>

      </wsp:All>
      </wsp:ExactlyOne>
      </wsp:Policy>
      <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http" />

      <wsdl:operation name="createReservation">
      <soap:operation style="document"
      soapAction="http://oscars.es.net/OSCARS/createReservation" />
      <wsdl:input>
      <wsp:policy xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
      xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
      xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
      wsu:Id="signedMsgPolicy" >
      <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
      <sp:Body />
      </sp:SignedParts>
      </wsp:policy>
      <soap:body use="literal" parts="createReservation" />
      </wsdl:input>
      <wsdl:output>
      <soap:body use="literal"
      parts="createReservationResponse" />
      </wsdl:output>
      <wsdl:fault name="AAAErrorException">
      <soap:fault name="AAAErrorException" use="literal" />
      </wsdl:fault>
      <wsdl:fault name="BSSErrorException">
      <soap:fault name="BSSErrorException" use="literal" />
      </wsdl:fault>
      </wsdl:operation>

      <wsdl:operation name="queryReservation">
      <soap:operation style="document"
      soapAction="http://oscars.es.net/OSCARS/queryReservation" />
      <wsdl:input>
      <wsp:policy xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
      xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
      xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
      wsu:Id="signedMsgPolicy" >
      <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
      <sp:Body />
      </sp:SignedParts>
      </wsp:policy>
      <soap:body use="literal" parts="queryReservation" />

      <!-- <wsp:PolicyReference URI="#signedMsgPolicy"
      wsdl:required="true" /> -->
      </wsdl:input>
      <wsdl:output>
      <soap:body use="literal"
      parts="queryReservationResponse" />
      <!-- <wsp:PolicyReference URI="#unsignedMsgPolicy"
      wsdl:required="true" /> -->
      </wsdl:output>
      <wsdl:fault name="AAAErrorException">
      <soap:fault name="AAAErrorException" use="literal" />
      </wsdl:fault>
      <wsdl:fault name="BSSErrorException">
      <soap:fault name="BSSErrorException" use="literal" />
      </wsdl:fault>
      </wsdl:operation>
      <wsdl:operation name="Notify">
      <soap:operation
      soapAction="http://oscars.es.net/OSCARS/Notify" />
      <wsdl:input>
      <soap:body use="literal" parts="Notify" />
      </wsdl:input>
      </wsdl:operation>
      </wsdl:binding>

      <wsdl:service name="OSCARS">
      <wsdl:port name="OSCARS" binding="tns:OSCARSSOAP">
      <soap:address
      location="https://oscars-dev.es.net:9090/axis2/services/OSCARS" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mrthompson@lbl.gov Mary Thompson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: