论坛首页 Java企业应用论坛

xfire异常:For input string: ""

浏览 2915 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2012-09-21  
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)
可能原因:xfire不识别  href这种赋值方式
如何才能让xfire识别 href 这种参数赋值格式?
   发表时间:2012-09-21  
java.lang.NumberFormatException: For input string: ""
   at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)

你需要数字  但传过来“” 
0 请登录后投票
   发表时间:2012-09-27  
是的,你根本没传数据过去,数据为“”
0 请登录后投票
   发表时间:2012-09-29  
问题原因是xfire、cxf不能支持<param3 href="#id0"/><multiRef id="id0"..... 格式的数据,详见:http://stackoverflow.com/questions/4510101/soap-href-xml-mapping-problem-which-mapping-helps
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics