views:

108

answers:

1

I am trying to call an Axis2 web service using a code like:

stub = new MyServiceStub("http://server/app/services/MyService");
stub.ping();

Stubs/skeletons are generated with codegen. I can interact correctly with the web service from other clients (even something low level written with SAAJ) but not from a stupid stub call.

I am getting the following error:

org.apache.axis2.AxisFault: Transport error: 501 Error: Not Implemented
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:298)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:192)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at my.package.stub.MyServiceStub.ping(MyServiceStub.java:266)

Has someone encountered this and know the solution?

I need to configure the Stub somehow to call the web-service (I'm sure this is a configuration issue). The web-service is already deployed and runs for some time.

Thank you!

A: 

I just managed to fix this issue using details from the following article.

All I did was add the following code before the call:

stub._getServiceClient().getOptions()
        .setProperty(HTTPConstants.HTTP_PROTOCOL_VERSION, HTTPConstants.HEADER_PROTOCOL_10);

Thank you for your time!

userTT