Unable to invoke web service from stub generated by axis2

View: New views
2 Messages — Rating Filter:   Alert me  

Unable to invoke web service from stub generated by axis2

by rbms :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi I am unable to invoke webservice from stub created from WSDL by axis2.

When I import the WSDL in SoapUI it works fine. (web service executes fine and returns results.

I get following error.
**********************
org.apache.axis2.AxisFault: Read timed out
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
        .....
        .....
        .....
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        .....
        .....
        .....
****************************

I put TCPMonitor to intercept call to server. I can see that calls goes to server. And web service returns results after some time (see timeout below code)

Following is my code. The code is generated by eclipse code generation plugin.
**********************
                com.gene.esb._default.ramesh.proxytest.rameshhelloworld.Ramesh_ProxyTestServiceStub stub = new com.gene.esb._default.ramesh.proxytest.rameshhelloworld.Ramesh_ProxyTestServiceStub("http://localhost:8080/soap/testWS");
                stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(10*1000);
                com.gene.esb._default.ramesh.proxytest.rameshhelloworld.Ramesh_ProxyTestServiceStub.RameshHelloWorld rameshHelloWorld4 = (com.gene.esb._default.ramesh.proxytest.rameshhelloworld.Ramesh_ProxyTestServiceStub.RameshHelloWorld) getTestObject(com.gene.esb._default.ramesh.proxytest.rameshhelloworld.Ramesh_ProxyTestServiceStub.RameshHelloWorld.class);
                // TODO : Fill in the rameshHelloWorld4 here
                __RameshHWInput request = new __RameshHWInput();
                request.setRequest("This is input");
                rameshHelloWorld4.setRameshHWInput(request);
                RameshHelloWorldResponse response = stub.RameshHelloWorld(rameshHelloWorld4);
                //stub._getServiceClient().
                assertNotNull(response);
**************************

The test case fails after 10 seconds. If I increase the timout to 60 seconds, the test case fails after 60 seconds.

Any help is appreaciated.


Re: Unable to invoke web service from stub generated by axis2

by Dominique Labar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My suggestion consists of debugging the server side by attaching the Axis2 Java code/thread from Eclipse.
The recipe is:
1. Start Tomcat with the required flags and  parameters:
    start C:\...\apache-tomcat-6.0.20\bin\catalina jpda start
    (eventually look inside the catalina.bat to identfy the debug port, 8000
2. From Eclipse, attach Tomcat with the remote debugger, see remote Java Application from de debug configuration panel, breakpoint your service code, later go down in the axis2 stack
 
consume the service again;

2009/10/29 rbms <rbms@...>

Hi I am unable to invoke webservice from stub created from WSDL by axis2.

When I import the WSDL in SoapUI it works fine. (web service executes fine
and returns results.

I get following error.
**********************
org.apache.axis2.AxisFault: Read timed out
       at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
       .....
       .....
       .....
Caused by: java.net.SocketTimeoutException: Read timed out
       at java.net.SocketInputStream.socketRead0(Native Method)
       .....
       .....
       .....
****************************

I put TCPMonitor to intercept call to server. I can see that calls goes to
server. And web service returns results after some time (see timeout below
code)

Following is my code. The code is generated by eclipse code generation
plugin.
**********************

com.gene.esb._default.ramesh.proxytest.rameshhelloworld.Ramesh_ProxyTestServiceStub
stub = new
com.gene.esb._default.ramesh.proxytest.rameshhelloworld.Ramesh_ProxyTestServiceStub("http://localhost:8080/soap/testWS");
               stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(10*1000);

com.gene.esb._default.ramesh.proxytest.rameshhelloworld.Ramesh_ProxyTestServiceStub.RameshHelloWorld
rameshHelloWorld4 =
(com.gene.esb._default.ramesh.proxytest.rameshhelloworld.Ramesh_ProxyTestServiceStub.RameshHelloWorld)
getTestObject(com.gene.esb._default.ramesh.proxytest.rameshhelloworld.Ramesh_ProxyTestServiceStub.RameshHelloWorld.class);
               // TODO : Fill in the rameshHelloWorld4 here
               __RameshHWInput request = new __RameshHWInput();
               request.setRequest("This is input");
               rameshHelloWorld4.setRameshHWInput(request);
               RameshHelloWorldResponse response =
stub.RameshHelloWorld(rameshHelloWorld4);
               //stub._getServiceClient().
               assertNotNull(response);
**************************

The test case fails after 10 seconds. If I increase the timout to 60
seconds, the test case fails after 60 seconds.

Any help is appreaciated.


--
View this message in context: http://www.nabble.com/Unable-to-invoke-web-service-from-stub-generated-by-axis2-tp26105456p26105456.html
Sent from the Axis - User mailing list archive at Nabble.com.