日期:2014-05-17  浏览次数:20613 次

xfire异常:For input string: ""
soap包中,包含:
<param3 href="#id0"/>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
3000
</multiRef>
java代码中,
@WebService(name = "**", targetNamespace = "***")
@SOAPBinding(use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
抛出类型转换异常:
java.lang.NumberFormatException: For input string: ""
  at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
  at java.lang.Long.parseLong(Long.java:424)
  at java.lang.Long.parseLong(Long.java:461)
  at org.codehaus.xfire.aegis.AbstractMessageReader.getValueAsLong(AbstractMessageReader.java:78)
请大侠指点!

------解决方案--------------------
这里很明确了,就是NumberFormatException,应为你调用Long.parseLong() 时参数输入为"".

java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:424)
at java.lang.Long.parseLong(Long.java:461)
at org.codehaus.xfire.aegis.AbstractMessageReader.getValueAsLong(AbstractMessageReader.java:78)
------解决方案--------------------
java.lang.NumberFormatException: For input string: ""
获得的是个空串