jax-ws
  1. jax-ws
  2. JAX_WS-902

C# properties with [MessageHeader] attribute not present in generated Java code

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: current
    • Fix Version/s: not determined
    • Component/s: wsimport
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

    • Issuezilla Id:
      902

      Description

      I'm generating Java classes from the WSDL of a C# WCF service in order to call
      that service. However, properties marked with the [MessageHeader] attribute in
      C# are not present in the Java code generated by wsimport, hence I'm unable to
      call the WCF service from said Java code.

      Excerpt from the WSDL:

      <wsdl:message name="RunMultipleTestsResponse">
      <wsdl:part name="parameters" element="tns:RunMultipleTestsResponse" />
      </wsdl:message>
      <wsdl:message name="RunMultipleTestsResponse_Headers">
      <wsdl:part name="ErrorIdentifier" element="tns:ErrorIdentifier" />
      <wsdl:part name="Result" element="tns:Result" />
      <wsdl:part name="ResultDesc" element="tns:ResultDesc" />
      </wsdl:message>
      ...
      <wsdl:operation name="RunMultipleTests">
      <soap:operation
      soapAction="http://mixcontrol.org/Services/2009/09/16/IUnitTestService/RunMultip
      leTests" style="document" />
      <wsdl:input name="RunMultipleTestsRequest">
      <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output name="RunMultipleTestsResponse">
      <soap:header message="tns:RunMultipleTestsResponse_Headers"
      part="ErrorIdentifier" use="literal" />
      <soap:header message="tns:RunMultipleTestsResponse_Headers" part="Result"
      use="literal" />
      <soap:header message="tns:RunMultipleTestsResponse_Headers"
      part="ResultDesc" use="literal" />
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>

      As you can see there is a RunMultipleTestsResponse_Headers message defined with
      3 properties I require, but these properties are not present in the generated
      Java class.

      My wsimport commandline is as follows:

      wsimport.bat -p za.co.krs.matrixlead.unittest -s C:\dev\jax-ws\output\ -
      verbose -extension -Xnocompile

      (-extension is required, otherwise I get errors about non-unique body parts.)

      This seems like a defect to me - please advise if this is so, or if I simply
      need to pass different arguments to wsimport (or possibly custom JAXB bindings
      with the -b flag).

      For reference, the same WSDL is correctly parsed by Apache Axis 1.5.2 and the
      resultant classes have all the fields that I require.

        Activity

        Hide
        perrito666 added a comment -

        Created an attachment (id=283)
        WSDLs to replicate issue

        Show
        perrito666 added a comment - Created an attachment (id=283) WSDLs to replicate issue
        Hide
        jitu added a comment -

        The wsdl uses additional headers in the binding. Use -XadditionalHeaders option

        Show
        jitu added a comment - The wsdl uses additional headers in the binding. Use -XadditionalHeaders option
        Hide
        kithouna added a comment -

        Using -XadditionalHeaders causes the following error to be generated multiple times for different classes:

        [ERROR] A class/interface with the same name "packagename.ClassName" is already in use. Use a class customization to resolve this conflict.
        [ERROR] (Relevant to above error) another "ClassName" is generated from here.

        as well as:

        [ERROR] Two declarations cause a collision in the ObjectFactory class.

        Show
        kithouna added a comment - Using -XadditionalHeaders causes the following error to be generated multiple times for different classes: [ERROR] A class/interface with the same name "packagename.ClassName" is already in use. Use a class customization to resolve this conflict. [ERROR] (Relevant to above error) another "ClassName" is generated from here. as well as: [ERROR] Two declarations cause a collision in the ObjectFactory class.

          People

          • Assignee:
            Unassigned
            Reporter:
            perrito666
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: