3 Replies Latest reply on May 19, 2009 2:50 AM by smartz

    [ERROR] Invalid header

      I am trying to consume a WSDL using wsconsume from JBossWS-3.1.2.GA, but I am unable to do so, if a wsdl:message/wsdl:part node defines a "type" instead of an "element".

      The error I get is:

      [wsconsume] Command invoked: org.jboss.wsf.spi.tools.cmd.WSConsume -k -o generated\classes -s generated\src -v wsdl.wsdl
      [wsconsume] parsing WSDL...
      [wsconsume] [ERROR] Invalid header "SoapHeader" in operation Operation: part must specify a "element" attribute
      [wsconsume] line 40 of file:/wsdl.wsdl


      Please find the WSDL below. Please note it is a perfectly legal WSDL as per W3C http://www.w3.org/TR/wsdl#_message, and relative XSD, and that other JAX-WS implementations (CXF) consume the WSDL correctly.

      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="wsdl" targetNamespace="http://localhost/service/"
       xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://localhost/service/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      
       <types>
       <schema xmlns="http://www.w3.org/2001/XMLSchema"
       targetNamespace="http://localhost/service/">
       <element name="OperationRequest">
       <complexType>
       <sequence>
       <element name="request" type="string"></element>
       </sequence>
       </complexType>
       </element>
       <element name="OperationResponse">
       <complexType>
       <sequence>
       <element name="response" type="string"></element>
       </sequence>
       </complexType>
       </element>
       <element name="SoapHeader">
       <complexType>
       <sequence>
       <element name="transactionID" type="string" />
       </sequence>
       </complexType>
       </element>
       </schema>
       </types>
      
       <message name="OperationRequest">
       <part name="parameters" element="tns:OperationRequest"></part>
       </message>
       <message name="OperationResponse">
       <part name="parameters" element="tns:OperationResponse"></part>
       </message>
       <message name="SoapHeader">
       <part name="SoapHeader" type="tns:SoapHeader" />
       </message>
      
       <portType name="ServicePort">
       <operation name="Operation">
       <input name="operationRequest" message="tns:OperationRequest" />
       <output name="operationResponse" message="tns:OperationResponse" />
       </operation>
       </portType>
      
       <binding name="Binding" type="tns:ServicePort">
       <soap:binding style="document"
       transport="http://schemas.xmlsoap.org/soap/http" />
       <operation name="Operation">
       <soap:operation soapAction="http://localhost/service/Operation" />
       <input name="operationRequest">
       <soap:body use="literal" />
       <soap:header message="tns:SoapHeader" part="SoapHeader"
       use="literal" />
       </input>
       <output name="operationResponse">
       <soap:body use="literal" />
       <soap:header message="tns:SoapHeader" part="SoapHeader"
       use="literal" />
       </output>
       </operation>
       </binding>
      
       <service name="Service">
       <port name="Port" binding="tns:Binding">
       <soap:address location="http://localhost/service" />
       </port>
       </service>
      
      </definitions>


      Is this a bug? Shall I open a JIRA for JBWS?
      Thanks in advance for any advice, and kind regards.

        • 1. Re: [ERROR] Invalid header
          asoldano

          Please try directly using the Sun's tools. The exception you get comes from the Sun's impl (the jbossws-native jaxws tooling is basically wrapper of the Sun's one). If you still get the exception, please fill it directly to Sun. Othere wise post here again and create the jira on the JBWS project JIRA. Thanks.

          • 2. Re: [ERROR] Invalid header

             

            "alessio.soldano@jboss.com" wrote:
            Please try directly using the Sun's tools. The exception you get comes from the Sun's impl (the jbossws-native jaxws tooling is basically wrapper of the Sun's one). If you still get the exception, please fill it directly to Sun. Othere wise post here again and create the jira on the JBWS project JIRA. Thanks.


            Ciao Alessio,

            and thanks for your response.
            I have followed your suggestion, and tried using wsimport both from JDK6's JAX-WS RI 2.1.1 and from the latest RI 2.1.7, and both have the issue.

            For future reference, I have opened a discussion on Sun's forums:
            http://forums.sun.com/thread.jspa?threadID=5387214
            http://forums.java.net/jive/message.jspa?messageID=346709

            • 3. Re: [ERROR] Invalid header