Axis2 - always getting 404 errors
Asked Answered
L

2

7

I'm trying to move some Web Service stubs from Metro to Axis2, however after generating my stubs using wsdl2java I'm constently getting 404 errors whenever I try and make a service call.

16/12/2010 11:14:57 AM org.apache.axis2.deployment.ModuleDeployer deploy
INFO: Deploying module: addressing-1.5.3-jar - file:/C:/Users/xxx/.m2/repository/org/apache/axis2/axis2/1.5.3/axis2-1.5.3-jar.jar
16/12/2010 11:14:57 AM org.apache.axis2.transport.http.HTTPSender sendViaPost
INFO: Unable to sendViaPost to url[xxxx]
org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found
    at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:307)
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:200)
    at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at au.com.jpaterso.betcalc.axis2.tab.LoginStub.getKey(LoginStub.java:184)
    at au.com.jpaterso.betcalc.axis2.tab.Test.main(Test.java:13)
Exception in thread "main" org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found
    at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:307)
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:200)
    at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at au.com.jpaterso.betcalc.axis2.tab.LoginStub.getKey(LoginStub.java:184)
    at au.com.jpaterso.betcalc.axis2.tab.Test.main(Test.java:13)

The URL that it's trying to connect to is definitely correct as I can access it via my browser/SoapUI.

Any help would be greatly appreciated!

Thanks, Joseph.

Louettalough answered 16/12, 2010 at 0:21 Comment(1)
Having some troubles accessing some Web Services that I believe will be fixed by using Axis2. If that's not the case I'll move back to Metro!Louettalough
B
2

You didn't provide much information about the environment in which you try to deploy your WS. E.g. is this a webapp running under Tomcat/JBoss or maybe the standalone server deployed with Axis2?

From the trace that you have posted I suppose that there is a connection with your server but your WS is not successfully deployed. I assume that you may use the standalone server for your tests and I suggest:

  1. Go to your WS repository. On my test machine this would be something like ~/axis2-x.x.x/repository/services and make sure that your service is there (either the .aar file or the unpacked version).

  2. Start the server and check if your service is really deployed. On my installation, for example the server will generate the following output (not complete):

    me@melinuxpc:~/axis2-1.5.1/bin> ./axis2server.sh
    Using AXIS2_HOME: xxx
    Using JAVA_HOME: xxx
    Using JAVA_OPTS: -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n Listening for transport dt_socket at address: 8000 [INFO] [SimpleAxisServer] Starting [INFO] [SimpleAxisServer] Using the Axis2 Repository xxx [SimpleAxisServer] Using the Axis2 Repository xxx [SimpleAxisServer] Using the Axis2 Configuration File xxx [INFO] Clustering has been disabled [INFO] Deploying module: xxx [INFO] Deploying Web service: MyTestService - file: ~/axis2-1.5.1/repository/services/MyTestService/

Check if your web service is deployed and there are no errors. You may check if the WSDL of the service is available "in the browser". On my test machine the URL will be:

http://localhost:8080/axis2/services/MyTestService?wsdl

While a list with all deployed services may be seen at:

http://localhost:8080/axis2/services/

And do not be too quick in abandoning Axis2 ;)

Good luck!

Bulldoze answered 17/12, 2010 at 10:8 Comment(1)
Thanks for the very detailed answer :). I'm actually accessing a 3rd party web service, and the WSDL is definitely accessible via my browser. Only Axis2 is giving me the issue, and I can call those services using either Metro or CXF with no issue. I'm not at work now so can't test, but I'll try intercepting the requests to try and figure out whether they're going in the right direction.Louettalough
K
2

I also see this error when use "axis2-wsdl2code-maven-plugin" to generate stub for a .NET webservice (.asmx).

I fixed by disable "chunked" of _serviceClient. Only add below code in method Constructor of file stub.

_serviceClient.getOptions().setProperty(HTTPConstants.CHUNKED, "false");
Kaiserslautern answered 17/5, 2014 at 2:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.