4 Replies Latest reply on Apr 5, 2005 10:33 PM by jason.greene

    Problems with type unsignedLong OUT & INOUT in WSDL

    anders.hedstrom

      Hi,

      I have a WSDL that defines a webservice with a couple of parameters. One parameter is an OUT parameter and another one is an INOUT parameter. Both these parameters are of the type xsd:unsignedLong.

      I use wscompile, version (1.1.1, build R5) from jwsdp-1.4 to generate the SI, SEI and the mapping file. The mapping file maps these two parameters to java.math.BigInteger.

      <method-param-parts-mapping>
       <param-position>8</param-position>
       <param-type>java.math.BigInteger</param-type>
       <wsdl-message-mapping>
       <wsdl-message xmlns:wsdlMsgNS="http://soapinterop.org/">wsdlMsgNS:storedProcedureRequest</wsdl-message>
       <wsdl-message-part-name>RecordNumber</wsdl-message-part-name>
       <parameter-mode>INOUT</parameter-mode>
       </wsdl-message-mapping>
      </method-param-parts-mapping>
      
      <method-param-parts-mapping>
       <param-position>10</param-position>
       <param-type>java.math.BigInteger</param-type>
       <wsdl-message-mapping>
       <wsdl-message xmlns:wsdlMsgNS="http://soapinterop.org/">wsdlMsgNS:storedProcedureResponse</wsdl-message>
       <wsdl-message-part-name>ReturnCode</wsdl-message-part-name>
       <parameter-mode>OUT</parameter-mode>
       </wsdl-message-mapping>
      </method-param-parts-mapping>

      The parameters has the type javax.xml.rpc.holders.BigIntegerHolder in the SEI.
      public void storedProcedure(..., javax.xml.rpc.holders.BigIntegerHolder recordNumber,.., javax.xml.rpc.holders.BigIntegerHolder returnCode, ...) throws
       java.rmi.RemoteException;


      I deploy my SLSB that consumes this webservice on JBoss 4.0.1 and try to perform the call to the webservice, and I get the following exception;
      ERROR [JavaUtils] Cannot set holder value '262' on javax.xml.rpc.holders.BigIntegerHolder


      If I by hand change my mapping file to use org.apache.axis.types.UnsignedLong instead of java.math.BigInteger and I also change my SEI to use org.apache.axis.holders.UnsignedLongHolder instead of javax.xml.rpc.holders.BigIntegerHolder it all works like a charm?! (This is how the SEI looks if you create it with axis tool WSDL2Java)

      How come? Everywhere I look I see that JBoss recommends the use of wscompile to generate the needed files. Is it not possible to map an unsignedLong OUT & INOUT parameter against BigIntegerHolder?

      I have tried this with wscompile version (1.1.2_01, build R40) from jwsdp-1.5 as well, but the mapping file and SEI created are identical to the ones created with wscompile version (1.1.1, build R5).

      //Anders =)