简体   繁体   中英

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(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!

是的,我已经尝试了没有Axis 2,只能使用javax.xml.soap.SOAPConnection并且是成功的:

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

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM