单独写main调用没有问题....但用此方法调用报错"The server did not recognise the action which it received"
public String send(Application application, User user) throws Exception {
try{
Object[] opAddEntryArgs = new Object[] { application.getXml() };
Class[] classes = new Class[] { String.class };
QName opAddEntry = new QName("http://ws.apache.org/axis2","processRequest");
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference(
"http://localhost:8080/axis2/services/ProcessServer");
options.setTo(targetEPR); String xml = (serviceClient.invokeBlocking(opAddEntry,opAddEntryArgs, classes)[0]).toString();
application.setXml(xml);
}catch(Exception e){
e.printStackTrace();
}
}
org.apache.axis2.AxisFault: The server did not recognise the action which it received: 
at org.apache.axis2.handlers.addressing.AddressingInFaultHandler.invoke(AddressingInFaultHandler.java:114)
at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:251)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:160)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:364)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
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:539)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:520)
at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:102)
at org.sanfan.cai.connector.ProcessServerServiceConnector.send(ProcessServerServiceConnector.java:108)
at org.sanfan.cai.action.SubmissionThread.run(SubmissionThread.java:47)

解决方案 »

  1.   

    因那是不正确的soap action,好好检查一下wsdl文件。
      

  2.   

    晕,菜鸟错误,自己已经解决了........
    invoke a web service with another web service:axis2,用client code调用一个web service,ok;用另一个web service 调用这个web service,failed。抛出异常:The server did not recognise the action which it received。Solutions:在service client的options里setAction,也就是把operation name设置进去。这样server就能找到这个action了。     serviceClient = new ServiceClient();
         options = new Options();
         options.setTransportInProtocol("SOAP");
         options.setTo(new EndpointReference(endPointReference));
         options.setAction(opName);
         serviceClient.setOptions(options);
      

  3.   

    ok解决了就好, 祝贺LZ顺利解决问题.!
      

  4.   

    我也出现了这个问题,用main方法调用可以成功,用stub方式调用就报这个错。在一个类中定义全局变量stub,再写几个要调用的方法(见下面代码),实例化A时再设置Stub的鉴权参数,其他地方通过A.update(param)调用。
    public class A
    {
        private ...Stub stub;
        public A(String url)
        {
            stub = new ...Stub(url);
        }
        public static String update(String param)
       {
           stub.update(param);
       }
    }
      

  5.   

    Options中试过options.setAction("update"),还是报同样的错误