[jboss-user] [JBoss Web Services Development] - NumberFormatException: empty String

hadi mallah do-not-reply at jboss.com
Tue May 11 17:13:38 EDT 2010


hadi mallah [http://community.jboss.org/people/hadimallah] created the discussion

"NumberFormatException: empty String"

To view the discussion, visit: http://community.jboss.org/message/542422#542422

--------------------------------------------------------------
I'm using JBoss 4.2.3.GA

I have implemented and deployed a WS, the request, the response and the exception is below.

My question is how can I define a parameter of type double or int for the web service method, and the client who will invoke my WS might send nothing, as demostrated in the request below, so if i changed the double param to string it works fine, but i need to define it as int or double, I tried Double and Integer ..but did not work, same problem.

Appreciate the help.


wsdl:

<message name="xxx_getTest">
    <part name="String_1" type="xsd:string">
    </part>
    <part name="String_2" type="xsd:string">
    </part>
    <part name="String_3" type="xsd:string">
    </part>
    <part name="String_4" type="xsd:string">
    </part>
    <part name="String_5" type="xsd:string">
    </part>
    <part name="Date_6" type="xsd:dateTime">
    </part>
    <part name="double_7" type="xsd:double">
    </part>
  </message>


Request:

 <soapenv:Body>
  <ns1:getTest soapenv:encodingStyle=' http://schemas.xmlsoap.org/soap/encoding/ http://schemas.xmlsoap.org/soap/encoding/' xmlns:ns1=' http://xxx.xxxx.xxx/ http://xxx.xxxx.xxx/'>
   <String_1 xmlns:xsd=' http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema' xmlns:xsi=' http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance' xsi:type='xsd:string'>54654654</String_1>
   <String_2 xmlns:xsd=' http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema' xmlns:xsi=' http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance' xsi:nil='true' xsi:type='xsd:string'/>
   <String_3 xmlns:xsd=' http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema' xmlns:xsi=' http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance' xsi:type='xsd:string'>3213546546</String_3>
   <String_4 xmlns:xsd=' http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema' xmlns:xsi=' http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance' xsi:type='xsd:string'>316546546</String_4>
   <String_5 xmlns:xsd=' http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema' xmlns:xsi=' http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance' xsi:type='xsd:string'>321354654</String_5>
   <Date_6 xmlns:xsd=' http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema' xmlns:xsi=' http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance' xsi:type='xsd:dateTime'>2010-05-11T20:18:13.698Z</Date_6>
   <double_7 href='#id0'/>
  </ns1:getTest>
 </soapenv:Body>

Response:

<env:Envelope xmlns:env=' http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/'>
 <env:Header/>
 <env:Body>
  <env:Fault xmlns:env=' http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/'>
   <faultcode>env:Server</faultcode>
   <faultstring>empty String</faultstring>
  </env:Fault>
 </env:Body>
</env:Envelope>

Exception:

java.lang.NumberFormatException: empty String
    at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:994)
    at java.lang.Double.valueOf(Double.java:447)
    at org.jboss.xb.binding.SimpleTypeBindings.unmarshal(SimpleTypeBindings.java:720)
    at org.jboss.ws.core.jaxrpc.binding.SimpleDeserializer.deserialize(SimpleDeserializer.java:59)
    at org.jboss.ws.core.jaxrpc.binding.SimpleDeserializer.deserialize(SimpleDeserializer.java:47)

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/542422#542422]

Start a new discussion in JBoss Web Services Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2047]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100511/e75614e1/attachment.html 


More information about the jboss-user mailing list