码上敲享录 > java常见报错解答 > 解Unmarshalling Error: unexpected element (uri:"", local:"name"). Expected elements are <{}arg0>

解Unmarshalling Error: unexpected element (uri:"", local:"name"). Expected elements are <{}arg0>

上一章章节目录下一章 2019-02-22已有54人阅读 评论(0)

解Unmarshalling Error: unexpected element (uri:"", local:"name"). Expected elements are <{}arg0>


解决方法:

调用webservice接口传参时报错Unmarshalling Error: unexpected element (uri:"", local:"name"). Expected elements are <{}arg0>

原因是服务端的服务接口参数前没加@WebParam(name = "name")

import javax.jws.WebMethod;

import javax.jws.WebParam;

import javax.jws.WebService;

import javax.xml.ws.BindingType;

@WebService(targetNamespace="http://test.com/")

public interface WebServiceServerI {

@WebMethod

public String sayHello(@WebParam(name = "name")String name);

}


0
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交