You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Shantanu Sen <ss...@pacbell.net> on 2006/07/12 10:04:41 UTC

passing boxed type parameter using rpc/lit

I have an SEI method as follows:

public interface MySEI extends Remote {
      public Integer add(int  a, Integer b, int c, int d) throws RemoteException;
}

When the java2wsdl is run (Axis 1.4) the input message generated with various styles are as follows:

rpc/enc:
----------
<wsdl:message name="addRequest">
      <wsdl:part name="in0" type="xsd:int"/>
      <wsdl:part name="in1" type="soapenc:int"/>
      <wsdl:part name="in2" type="xsd:int"/>
      <wsdl:part name="in3" type="xsd:int"/>
</wsdl:message>
----------
 doc/lit(wrapped)
----------
<element name="add">
    <complexType>
     <sequence>
      <element name="in0" type="xsd:int"/>
      <element name="in1" type="xsd:int"/>
      <element name="in2" type="xsd:int"/>
      <element name="in3" type="xsd:int"/>
     </sequence>
    </complexType>
   </element>
...
<wsdl:message name="addRequest">
     <wsdl:part element="impl:add" name="parameters"/>
</wsdl:message>
----------

rpc/lit 
-------
<wsdl:message name="addRequest">
     <wsdl:part name="in0" type="xsd:int"/>
     <wsdl:part name="in1" type="xsd:int"/>
     <wsdl:part name="in2" type="xsd:int"/>
     <wsdl:part name="in3" type="xsd:int"/>
</wsdl:message>
------

So, if we generate the SEI from the WSDLs, only the rpc/enc produces the correct original SEI. The others produce:

public interface MySEI extends java.rmi.Remote {
    public int add(int in0, int in1, int in2, int in3) throws java.rmi.RemoteException;
}

which is incorrect.

My question is for rpc/lit should'nt it generate the nillable="true" in the part e.g.

<wsdl:part name="in1" type="xsd:int" nillable="true"/>

so that it is maaped to a java.lang.Integer?

Can't we use wrapped primitive types with rpc/lit?

The doc/lit(wrapped) generation looks like a bug - it should definitely have set the nillable="true". But I am not sure about the rpc./lit

How can I make the tool generate the correct type using rpc/lit?

Any comments welcome.

Shantanu