加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Webservice调用服务端 Unmarshalling Error: unexpected element

发布时间:2020-12-16 23:07:55 所属栏目:安全 来源:网络整理
导读:使用Axis2调用CXF服务端Webservice方法时: 报错:Unmarshalling Error: unexpected element (uri:"http://ejb.fss.keyman.com",local:"xmldata"). Expected elements are {}arg0 详细信息如下: org.apache.axis2.AxisFault: Unmarshalling Error: unexpect

使用Axis2调用CXF服务端Webservice方法时:

报错:Unmarshalling Error: unexpected element (uri:"http://ejb.fss.keyman.com",local:"xmldata"). Expected elements are <{}arg0>

详细信息如下:

org.apache.axis2.AxisFault: Unmarshalling Error: unexpected element (uri:"http://ejb.fss.keyman.com",local:"xmldata"). Expected elements are <{}arg0>
    at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:555)
    at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:531)
    at com.keyman.fss.test.FindResultByWorkIDTest.ReportResult(FindResultByWorkIDTest.java:69)
    at com.keyman.fss.test.FindResultByWorkIDTest.main(FindResultByWorkIDTest.java:80)


解决办法:

在Webservice服务端方法参数前面加上,@WebParam(name = "xmldata",targetNamespace = "http://ejb.fss.keyman.com")

命令空间之类的信息。

例子如下:

	public String findResultByWorkID(@WebParam(name = "xmldata",targetNamespace = "http://ejb.fss.keyman.com") String xmldata) {
	
		具体代码
	}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读