I don't understand some of the behavior of wsdl2java when run against a
running web service with "header" web parameters
("ParamDesc.setInHeader(true)"). The generated methods in the client
stub look quite different from the original ones; in particular, they
seem to have parameters that are not required:

The original server side WebMethod (within a @WebService) in Beehive
notation:
    public int testMethod(
      @WebParam(header=true) String s
    )   throws Exception

Turned into the following method in the autogenerated client stub:
    public template.TestMethodResponse testMethod(
      java.lang.String in0,
      template.TestMethod parameters
    ) throws java.rmi.RemoteException, java.lang.Exception

Instead, I would have expected something like:
    public int testMethod(
      String in0,
    ) throws java.rmi.RemoteException, java.lang.Exception

[For WSDL and sources, see attachments.]

The curiousities are:
1) the original had a return type int, the stub's return type is
template.TestMethodResponse
2) the original had one formal parameter of type String, the stub has
two parameters, one of type String and one of type
template.TestMethodResponse
3) if I use INOUT or OUT params, even more formal parameters get added
to testMethod's signature.

Note that the change of parameter names from "s" to "in0" was expected.

I'm not sure what the problem is, yet, and was just curious if there
were any known issues around this. Also note that everything works fine
if I set the "header" options to "false". Any ideas? Thanks much.

Cheers,

-michael



<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://template"; xmlns:apachesoap="http://xml.apache.org/xml-soap"; xmlns:impl="http://template"; xmlns:intf="http://template"; xmlns:tns1="http://lang.java"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
<!--WSDL created by Apache Axis version: 1.2RC2
Built on Nov 16, 2004 (12:19:44 EST)-->
 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="http://template"; xmlns="http://www.w3.org/2001/XMLSchema";>
   <import namespace="http://lang.java"/>
   <element name="in0" type="xsd:string"/>
   <element name="testMethod">
    <complexType>
     <sequence/>
    </complexType>
   </element>
   <element name="testMethodResponse">
    <complexType>
     <sequence>
      <element name="result" type="xsd:int"/>
     </sequence>
    </complexType>
   </element>
  </schema>
  <schema elementFormDefault="qualified" targetNamespace="http://lang.java"; xmlns="http://www.w3.org/2001/XMLSchema";>
   <complexType name="Exception">
    <sequence/>
   </complexType>
   <element name="Exception" type="tns1:Exception"/>
  </schema>
 </wsdl:types>

   <wsdl:message name="Exception">

      <wsdl:part element="tns1:Exception" name="Exception"/>

   </wsdl:message>

   <wsdl:message name="testMethodResponse">

      <wsdl:part element="impl:testMethodResponse" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="testMethodRequest">

      <wsdl:part element="impl:in0" name="in0"/>

      <wsdl:part element="impl:testMethod" name="parameters"/>

   </wsdl:message>

   <wsdl:portType name="Blank">

      <wsdl:operation name="testMethod">

         <wsdl:input message="impl:testMethodRequest" name="testMethodRequest"/>

         <wsdl:output message="impl:testMethodResponse" name="testMethodResponse"/>

         <wsdl:fault message="impl:Exception" name="Exception"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="BlankSoapBinding" type="impl:Blank">

      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="testMethod">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="testMethodRequest">

            <wsdlsoap:body parts="parameters" use="literal"/>

            <wsdlsoap:header message="impl:testMethodRequest" namespace="http://template"; part="in0" use="literal">

            </wsdlsoap:header>

         </wsdl:input>

         <wsdl:output name="testMethodResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

         <wsdl:fault name="Exception">

            <wsdlsoap:fault name="Exception" use="literal"/>

         </wsdl:fault>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="BlankService">

      <wsdl:port binding="impl:BlankSoapBinding" name="Blank">

         <wsdlsoap:address location="http://localhost:8080/jsr181-tck/template/Blank.jws"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>

Attachment: BlankSoapBindingStub.java
Description: BlankSoapBindingStub.java

Attachment: Blank.jws
Description: Blank.jws

Reply via email to