日期:2014-05-20  浏览次数:20793 次

客户端用axis2调webServer出错
The endpoint reference (EPR) for the Operation not found is http://127.0.0.1:8083/axis2/services/myWeb and the WSA Action = urn:anonOutInOp
报这样的错,不知道大家遇到了没
try{
ServiceClient serverClient=new ServiceClient();
Options option=new Options();
//option.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
//option.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
  //option.setTransportInProtocol(Constants.TRANSPORT_HTTP);
option.setTo(ed);
//serverClient.sendReceive(arg0, arg1)
//option.setAction("true");
  serverClient.setOptions(option);
  OMElement ee=createOMElent();
  System.out.println(ee);  
 
  OMElement resulet=serverClient.sendReceive(ee);
  //System.out.println(resulet);
  }catch(Exception fail)
{
fail.printStackTrace();
}


------解决方案--------------------
把关键的createOMElent(); 方法及wsdl帖上来看看呀,直接这么看,看不出来呀
------解决方案--------------------
1.检查http://127.0.0.1:8083/axis2/services/myWeb是否正确
2.检查你的本地桩stub中对应操作的请求参数类中的关于名称空间是否正确,尤其注意检查与请求操作名称相同的字符串(*Request)是否正确,可以考虑去掉(Request)

你的问题是找不到操作,说明你的本地桩有问题,重点关注2

axis2中首先检查请求消息的Post 中是否有操作?再检查SOAPAction中是否有操作?再检查请求的消息体SOAPBody中的<ns:操作名称>中的操作名称?如果上面三个检查中都没有发现已经发布的操作则报operation not found ,.........wsa = 错误!