开发者

org.apache.axis2.AxisFault: Transport error: 501 Error: Not Implemented

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(CommonsHTT开发者_如何学CPTransportSender.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!


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!


Yes, I have try without Axis 2 and only with javax.xml.soap.SOAPConnection and was sucessfull:

connection.setRequestProperty(HTTPConstants.HTTP_PROTOCOL_VERSION, HTTPConstants.HEADER_PROTOCOL_10);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜