码迷,mamicode.com
首页 > Web开发 > 详细

Webservice调用服务端 Unmarshalling Error: unexpected element (Xxx). Expected elements are Xxx

时间:2014-12-24 16:26:29      阅读:731      评论:0      收藏:0      [点我收藏+]

标签:unmarshalling error   localxmldata. expect   

使用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) {
	
		具体代码
	}


Webservice调用服务端 Unmarshalling Error: unexpected element (Xxx). Expected elements are Xxx

标签:unmarshalling error   localxmldata. expect   

原文地址:http://blog.csdn.net/yuechang5/article/details/42123765

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!