Hi Eran,
The server is Axis2 - its an existing
spring/hibernate/struts app with Axis2 v.92 added in.
Here's the stacktrace - I run the client via the
commandline with ant:
[echo] Starting rc client...
[java] org.apache.axis2.AxisFault: Read timed
out; nested exception is:
[java] java.net.SocketTimeoutException: Read
timed out; nested exception is:
[java] org.apache.axis2.AxisFault: Read timed
out; nested exception is:
[java] java.net.SocketTimeoutException: Read
timed out; nested exception is:
[java] org.apache.axis2.AxisFault: Read timed
out; nested exception is:
[java] java.net.SocketTimeoutException: Read
timed out; nested exception is:
[java] org.apache.axis2.AxisFault: Read timed
out; nested exception is:
[java] java.net.SocketTimeoutException: Read
timed out
[java] at
org.apache.axis2.clientapi.InOutMEPClient.invokeNonBlocking(InOutMEPClient.java:255)
[java] at
org.apache.axis2.clientapi.Call.invokeNonBlocking(Call.java:136)
[java] at
com.siemens.swa.plugins.clients.RCServiceClient.main(RCServiceClient.java:61)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at
java.lang.reflect.Method.invoke(Method.java:585)
[java] at
org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:193)
[java] at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:130)
[java] at
org.apache.tools.ant.taskdefs.Java.run(Java.java:705)
[java] at
org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:177)
[java] at
org.apache.tools.ant.taskdefs.Java.execute(Java.java:83)
[java] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[java] at
org.apache.tools.ant.Task.perform(Task.java:364)
[java] at
org.apache.tools.ant.Target.execute(Target.java:341)
[java] at
org.apache.tools.ant.Target.performTasks(Target.java:369)
[java] at
org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[java] at
org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[java] at
org.apache.tools.ant.Main.runBuild(Main.java:673)
[java] at
org.apache.tools.ant.Main.startAnt(Main.java:188)
[java] at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
[java] at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
[java] Caused by: org.apache.axis2.AxisFault:
Read timed out; nested exception is:
[java] java.net.SocketTimeoutException: Read
timed out; nested exception is:
[java] org.apache.axis2.AxisFault: Read timed
out; nested exception is:
[java] java.net.SocketTimeoutException: Read
timed out
[java] at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:154)
[java] at
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:100)
[java] at
org.apache.axis2.clientapi.InOutMEPClient.invokeNonBlocking(InOutMEPClient.java:245)
[java] ... 21 more
[java] Caused by: org.apache.axis2.AxisFault:
Read timed out; nested exception is:
[java] java.net.SocketTimeoutException: Read
timed out
[java] at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:204)
[java] at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:123)
[java] ... 23 more
[java] Caused by:
java.net.SocketTimeoutException: Read timed out
[java] at
java.net.SocketInputStream.socketRead0(Native Method)
[java] at
java.net.SocketInputStream.read(SocketInputStream.java:129)
[java] at
java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
[java] at
java.io.BufferedInputStream.read(BufferedInputStream.java:235)
[java] at
org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:77)
[java] at
org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105)
[java] at
org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1110)
[java] at
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1832)
[java] at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1592)
[java] at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
[java] at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:393)
[java] at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
[java] at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
[java] at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
[java] at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.transportConfigurationPOST(CommonsHTTPTransportSender.java:502)
[java] at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:182)
[java] ... 24 more
BUILD SUCCESSFUL
Total time: 1 minute 7 seconds
As stated, I'm probably doing something wrong or
weird, somewhere ;-) . Please let me know if there is
any more info I can provide or any hints on what else
I can try.
I'll be looking at
EchoRawXMLOnTwoChannelsTest.testEchoXMLCompleteASync().
after this emial, thanks for the tip.
Thanks!
iksrazal
--- Eran Chinthaka <[EMAIL PROTECTED]> wrote:
> Can you please send me the stacktrace too ?
>
> And are u calling a service hosted in a non-Axis2
> server ? Seems so, as
> your target epr seems its not in an Axis2 server.
> But since it seems you
> have done the code well, its a rare chance that the
> epr u set it wrong.
>
> BTW, did you look at the code in
>
EchoRawXMLOnTwoChannelsTest.testEchoXMLCompleteASync().
> It has the same
> code as what you are trying to do.
>
> Chinthaka
>
> trebor iksrazal wrote:
>
> >Hi Eran, thanks for the reply. I think I'm already
> >doing everything you mentioned - my client code is
> >basically the same as the EchoNonBlockingClient
> >example, which I believe has useSeparateListener
> equal
> >true and passes a callback into invokeNonBlocking.
> >
> >Of course, I'm sure I'm missing something simple.
> >Could you please give a look at the code below?
> >
> >public class RCServiceClient {
> > private static EndpointReference targetEPR =
> new
>
>EndpointReference("http://127.0.0.1:8080/swa/services/RCService");
> >
> > public static void main(String[] args) {
> > try {
> > OMElement payload =
> >ClientUtil.getEchoOMElement();
> >
> > Call call = new Call();
> > call.setTo(targetEPR);
> >
> > // The boolean flag informs the axis2
> >engine to use two separate transport connection
> > // to retrieve the response.
> > call.engageModule(new
> >QName(Constants.MODULE_ADDRESSING));
> >
> >call.setTransportInfo(Constants.TRANSPORT_HTTP,
> > Constants.TRANSPORT_HTTP,
> > true);
> >
> > //Callback to handle the response
> > Callback callback = new Callback() {
> > public void onComplete(AsyncResult
> >result) {
> > try {
> > System.out.println("inside
> >onComplete...");
> > StringWriter writer = new
> >StringWriter();
> >
>
>result.getResponseEnvelope().serializeWithCache(XMLOutputFactory.newInstance()
> >
> >.createXMLStreamWriter(writer));
> > writer.flush();
> >
> >System.out.println(writer.toString());
> >
> >
> > } catch (XMLStreamException e)
> {
> > reportError(e);
> > }
> > }
> >
> > public void reportError(Exception
> e) {
> > e.printStackTrace();
> > }
> > };
> >
> > //Non-Blocking Invocation
> > call.invokeNonBlocking("rcExecute",
> >payload, callback);
> >
> >
> > //Wait till the callback receives the
> >response.
> > System.out.println("RC Service
> executed,
> >sleeping until completion...");
> > while (!callback.isComplete()) {
> > Thread.sleep(1000);
> > }
> > //Need to close the Client Side
> Listener.
> > call.close();
> > System.out.println("RC Service
> >completed");
> >
> > } catch (AxisFault axisFault) {
> > axisFault.printStackTrace();
> > } catch (Exception ex) {
> > ex.printStackTrace();
> > }
> >
> > }
> >}
> >
> >public class ClientUtil {
> > public static OMElement getEchoOMElement() {
> > OMFactory fac =
> >OMAbstractFactory.getOMFactory();
> > OMNamespace omNs = fac.createOMNamespace(
> > "http://example1.org/example1",
> >"example1");
> >
> > OMElement method =
> >fac.createOMElement("rcExecute", omNs);
> > OMElement value =
> fac.createOMElement("Text",
> >omNs);
> > value.addChild(fac.createText(value, "Axis2
> >Echo String "));
> > method.addChild(value);
> >
> > return method;
> > }
> >}
> >
> >Thanks a lot,
> >trebor iksrazal
> >
> >--- Eran Chinthaka <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >>Hi Trebor,
> >>
> >>trebor iksrazal wrote:
> >>
> >>
> >>
> >>>Hi all,
> >>>
> >>>I've succesfully wrote a web service based off of
> >>>
> >>>
> >>the
> >>
> >>
> >>>EchoNonBlockingClient example in the user guide.
> >>>
> >>>
> >>I'm
> >>
> >>
> >>>using spring on the server side, if anyone needs
> >>>
> >>>
> >>help.
> >>
> >>
> >>>
> >>>
> >>>
> >>>
> >>Excellent, thanks for offering to help. I saw
> there
> >>are some people
> >>struggling to do the samething. If you have time,
> >>just explain what you
> >>did and how you did as a small tutorial and mail
> it
> >>here. If its good,
> >>we can put it in our Axis2 site.
> >>
> >>
> >>
> >>>However, the task I execute on the web service
> side
> >>>can take between 6 and 20 minutes. Its why I
> >>>
> >>>
> >>choosed
> >>
> >>
> >>>axis2, so I can execute it asynchronously. Yet it
> >>>gives me:
> >>>
> >>>java.net.SocketTimeoutException: Read timed out
> >>>
> >>>
> >>>
> >>>
> >>The reason for this is that the socket which you
> >>used to invoke server
> >>has timed out. What you can do is to use a
> separate
> >>listener and a pass
> >>a Callback, as Srinath has stated.
>
=== message truncated ===
"None are more hopelessly enslaved than those who falsely believe they are
free. -- Goethe"
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com