0

i am call web service with axis2 plugin .The methodology used is rpc.

the code main is :

       GetPayIDBillIDStub stub = new GetPayIDBillIDStub("http://80.91.4.113:8088/services/GetPayIDBillID_Proxy");
        stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
        GetPayIDBillIDStub.PaymentInput input = new GetPayIDBillIDStub.PaymentInput();
        input.setPassword("123456");
        input.setTelephone(2111111111);
        input.setUsername("test");
        paymentTelOPR.setPaymentTelOPRRequest(input);
        org.apache.axiom.om.OMFactory factory = org.apache.axiom.om.OMAbstractFactory.getOMFactory();
     paymentTelOPRResponseE = stub.paymentTelOPR(paymentTelOPRE.setPaymentTelOPRRequest(paymentTelOPR.getOMElement(GetPayIDBillIDStub.PaymentTelOPR.MY_QNAME, factory)));

error is :

Exception in thread "main" java.lang.IllegalArgumentException: The MessageContext does not have an associated SOAPFault.
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:556)
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 mypackage.GetPayIDBillIDStub.paymentTelOPR(GetPayIDBillIDStub.java:182)
at Run.main(Run.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

help for me.

reza rostami
  • 93
  • 1
  • 3
  • 8

2 Answers2

0

We recently had this Problem because the response contained no SOAPFault (in fact was the expected answer to the service call) but the http status code of the response was 5xx (500 in our case).

Maybe something similar in your case.

You can verify this by using an generic Webservice client like SoapUI which can also display the raw hhtp response.

Ecki
  • 46
  • 2
  • @cfrick the post is actually a form of answer - or at least one reason why the OP is having a problem. I'd suggest we leave it. – David Brossard Sep 26 '14 at 13:23
0

I know it is a late answer, but I can help the new engineers with my experience. I got the same error where I was using SOAP UI with my API. The problem started when I replaced my mocked response by a fault response just for testing it. But once I retried to use the correct code, it didn't work and it gave me this error. The solution was: that I have to delete the response because it is considered as a fault response and missing the fault code, When I created a new response and deleted the old one, it worked without getting this exception

Chris Sim
  • 4,054
  • 4
  • 29
  • 36