There has to be a simple answer for this that I haven't been able to
find.  This is one of those difficult things to search for because all
the terms are very common.

I have a simple value object class that is being sent via a simple web
service call.  Inside the class are some Integer variables that may
not be set when sent.  So I can easily create a new VO class, and send
it from my client to the server.

The problem is that on the server I get a NumberFormatException
because it is trying to create an Integer from an empty string.  The
exact error is:
java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        ...

Using tcpmon I see that the SOAP being sent is:
...
        <soapInsertUser xmlns="http://dataimport.processes.ix/xsd";>
           <arg0 xmlns="">
              <firstname>hank</firstname>
              <lastname>hank</lastname>
              <assignedUserID
xmlns:nil="http://ww.w3.org/2001/XMLSchema-instance"; nil:nil="true" />
           </arg0>
        </soapInsertUser>
...

So my question is... why is it taking a null value, and trying to call
parseInt on an empty string?  What I thought would have happened is
that it would correctly deserialize into a null value, or that it
wouldn't even send the null value in the SOAP call.

There has to be something simple that I am missing here.  I am using
Axis 2 and can provide code if necessary.  Please point me to any docs
that are applicable to this subject.

Regards,
Collin Peters

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to