Axis2 - always gets 404 errors

I am trying to move some Web service stubs from Metro to Axis2, however, after creating my stubs using wsdl2java, I constantly get 404 errors whenever I try to 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 he is trying to connect is definitely correct, as I can access it through my browser / SoapUI.

Any help would be greatly appreciated!

Thanks, Joseph.

+6
java web-services axis2
source share
2 answers

You did not provide much information about the environment in which you are trying to deploy your WS. For example. Is this webapp running under Tomcat / JBoss or maybe a standalone server deployed with Axis2?

From the trace you posted, I assume there is a connection to your server, but your WS has not been successfully deployed. I assume you can use a standalone server for your tests, and I suggest:

  • Go to the WS repository. On my test machine, it will be something like ~ / axis2-xxx / repository / services and make sure you have one (.aar file or unpacked version).

  • Start the server and check if your service is really deployed. During 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 to the dt_socket transport at 8000 [INFO] [SimpleAxisServer] Starting [INFO] [SimpleAxisServer] Using the Axis2 xSver [SimpleAxer] repository Using the Axis2 xxx repository [SimpleAxisServer] Using the Axis2 xxx configuration file [INFO] Clustering is disabled [INFO] Deploying the module: xxx [INFO] Deploying the web service: MyTestService - file: ~ / axis2-1.5.1 / repository / services / MyTestService /

Check if your web service is deployed and there are no errors. You can check if the WSDL services are available in the browser. On my test machine, the URL will look like this:

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

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

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

And do not give up Axis2 too quickly;)

Good luck

+2
source share

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

I fixed it by disabling "chunked" from _serviceClient. Add the code below to the Constructor method of the file stub.

 _serviceClient.getOptions().setProperty(HTTPConstants.CHUNKED, "false"); 
+2
source share

All Articles