Re: [Axis2] EchoNonBlockingDualClient problem
Hi everybody! I'm also experiencing the same problem. I run axis2 v0.93 on tomcat 5.5.7. My code is slightly different than the EchoNonBlockingDualClient but it's basically the same: public void startinsertMappingAnnotations(InsertMappingAnnotationsDocument requestDoc, final AstrodasPeerCallbackHandler callback) throws RemoteException { Call call = new Call(_serviceContext); call.setClientOptions(_clientOptions); MessageContext messageContext = getMessageContext(); _clientOptions.setSoapAction("insertMappingAnnotations"); // Uses two separate listeners: dual transport. call.engageModule(new QName(Constants.MODULE_ADDRESSING)); _clientOptions.setListenerTransportProtocol(Constants.TRANSPORT_HTTP); _clientOptions.setUseSeparateListener(true); // Sets the exception throwing status. _clientOptions.setExceptionToBeThrownOnSOAPFault(true); // Sets the properties. SOAPEnvelope envelope = createEnvelope(); setValueDoc(envelope,AstrodasPeerinsertMappingAnnotationsDatabindingSupporter.toOM(requestDoc)); messageContext.setEnvelope(envelope); call.invokeNonBlocking(operations[0], messageContext, new Callback() { public void onComplete(AsyncResult result) { Object object = AstrodasPeerinsertMappingAnnotationsDatabindingSupporter .fromOM(getElement(result.getResponseEnvelope(),"doc"), InsertMappingAnnotationsResponseDocument.class); callback.receiveResultinsertMappingAnnotations((InsertMappingAnnotationsResponseDocument) object); } public void reportError(Exception e) { callback.receiveErrorinsertMappingAnnotations(e); } }); } I also get the same problem using a dual transport blocking client: public InsertMappingAnnotationsResponseDocument insertMappingAnnotations(InsertMappingAnnotationsDocument requestDoc) throws RemoteException { MessageContext messageContext = getMessageContext(); Call call = new Call(_serviceContext); _clientOptions.setSoapAction("insertMappingAnnotations"); call.setClientOptions(_clientOptions); // Uses two separate listeners: dual transport. call.engageModule(new QName(Constants.MODULE_ADDRESSING)); _clientOptions.setListenerTransportProtocol(Constants.TRANSPORT_HTTP); _clientOptions.setUseSeparateListener(true); // Sets the exception throwing status. // Sets the properties. populateModules(call); SOAPEnvelope envelope = createEnvelope(); // Style is Doc. setValueDoc(envelope,AstrodasPeerinsertMappingAnnotationsDatabindingSupporter.toOM(requestDoc)); messageContext.setEnvelope(envelope); MessageContext responseMessageContext = call.invokeBlocking(operations[0],messageContext); SOAPEnvelope responseEnvelope = responseMessageContext.getEnvelope(); Object obj = AstrodasPeerinsertMappingAnnotationsDatabindingSupporter .fromOM(getElement(responseEnvelope,"doc"),InsertMappingAnnotationsResponseDocument.class); return (InsertMappingAnnotationsResponseDocument)obj; } The request arrives to the client and is executed successfully but the client doesn't get any response. Actually, the server sends a response to the client, here it is: xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> Client For input string: "0:0:0:0:0:0:1:6060"; nested exception is: .java.net.MalformedURLException: For input string: "0:0:0:0:0:0:1:6060"; nested exception is: .org.apache.axis2.AxisFault: For input string: "0:0:0:0:0:0:1:6060"; nested exception is: .java.net.MalformedURLException: For input string: "0:0:0:0:0:0:1:6060" http://myAxisServer/role/default org.apache.axis2.AxisFault: For input string: "0:0:0:0:0:0:1:6060"; nested exception is: .java.net.MalformedURLException: For input string: " 0:0:0:0:0:0:1:6060"; nested exception is: .org.apache.axis2.AxisFault: For input string: "0:0:0:0:0:0:1:6060"; nested exception is: .java.net.MalformedURLException: For input string: "0:0:0:0:0:0:1:6060" .at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:265) .at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:93) .at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:42) .at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:158) .at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:211) .at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:181) .at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) .at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Re: [Axis2] EchoNonBlockingDualClient problem
Hi,I have the same problem with Tomcat 5.5 and have two questions:1) Why does my client HTTP server is immediately closed and i get I/O exception when server tries to post the response? 2) Why does it print "waiting" when options.setUseSeparateListener() is passed false? (This is Antony Wilson's question actually) Thanks a lot.Ali Sadik KumlaliFIRST CASE + Original EchoNonBlockingDualClient.java + System.out.println("waiting..."); in while loopClient Log---testEchoNonBlockingDualClient: [java] - Deploying module : addressing [java] - Starting to process SOAP 1.1 message [java] v="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://10.10.10.103:6060/axis2/services/__ANONYMOUS_SERVICE__/__OPERATION_OUT_IN__http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://127.0.0.1:8080/axis2/services/MyService="http://schemas.xmlsoap.org/ws/2004/08/addressing">D3C49495E884E3019B11423375911122975BF946D7CFA918C611423375837211Axis2 Echo String example1:echo> [java] [SimpleHTTPServer] Stop calledServer Log--- Deploying module : addressing- Deploying module : security- Starting to process SOAP 1.1 message- I/O exception (org.apache.commons.httpclient.NoHttpResponseException) caught when processing request: The server 10.10.10.103 failed to respond- Retrying requestSECOND CASE: + Original EchoNonBlockingDualClient.java + System.out.println("waiting..."); in while loop &nbs p; + options.setUseSeparateListener(false); Client Log---testEchoNonBlockingDualClient: [java] - Deploying module : addressing [java] waiting... [java] - Starting to process SOAP 1.1 message [java] v="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymoushttp://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymoushttp://127.0.0.1:8080/axis2/services/MyServiceD3C49495E884E3019B11423376489274>:RelationshipType="wsa:Reply">6439FE16DCA2252A8E11423376486611soapenv:Header>Axis2 Echo String penv:Body>Server Log--- De ploying module : addressing- Deploying module : security- Starting to process SOAP 1.1 messagerobert lazarski <[EMAIL PROTECTED]> wrote: Could you start another thread with an axis2 prefix mentioning jboss ? I know jboss with web services ok, but it was with either axis 1 or jwsdp - not axis2 . Are you using wsdl and ejb ? Robert http://www.braziloutsource.com/On 3/13/06, Brian Shields < [EMAIL PROTECTED]> wrote:Tony,Apologies for jumping into this thread on an unr elated issue but i notice you have axis2 deployed on JBoss 4.0. I am about to undertakethis task and was wondering if there was any resources on the web tohelp in it. I dont have a lot of experience with JBoss so not looking forward to it!!Regards,BrianAntony Wilson wrote:>> I have not been able to get the EchonNonBlockingDualClient example to> work as described in the documentation. In my setup, I have Axis2 > deployed to JBoss 4.0.3 and I have modified the> userguide.example1.MyService to delay for about 10 seconds before> responding (leaving the 'echo' method). After packaging and deploying> the MyService.aar to Axis2, I run EchoNonBlockingDualClient> example...slightly modified to add a print statement within the while> loop...like so>>public static void main(String[] args) {>try { >OMElement payload = ClientUtil.getEchoOMElement();>>Options options = new Options();>options.setTo(targetEPR);>options.setTransportInProtocol (Constants.TRANSPORT_HTTP);>options.setUseSeparateListener(true);>>//Callback to handle the response>Callback callback = new Callback() {>public void onComplete(AsyncResult result) {>try {>StringWriter writer = new StringWriter();>> result.getResponseEnvelope().serialize(XMLOutputFactory.newInstance()>.createXMLStreamWriter(writer));>writer.flush ();>System.out.println(writer.toString());>>>} catch (XMLStreamException e) {>onError(e);>}>}>>public void onError(Exception e) {>e.printStackTrace();>}>};>>//Non-Blocking Invocation>ServiceClient sender = new ServiceClient(); >sender.setOptions(options);>sender.sendReceiveNonblocking(paylo
Re: [Axis2] EchoNonBlockingDualClient problem
Could you start another thread with an axis2 prefix mentioning jboss ? I know jboss with web services ok, but it was with either axis 1 or jwsdp - not axis2 . Are you using wsdl and ejb ? Robert http://www.braziloutsource.com/On 3/13/06, Brian Shields < [EMAIL PROTECTED]> wrote:Tony,Apologies for jumping into this thread on an unrelated issue but i notice you have axis2 deployed on JBoss 4.0. I am about to undertakethis task and was wondering if there was any resources on the web tohelp in it. I dont have a lot of experience with JBoss so not looking forward to it!!Regards,BrianAntony Wilson wrote:>> I have not been able to get the EchonNonBlockingDualClient example to> work as described in the documentation. In my setup, I have Axis2 > deployed to JBoss 4.0.3 and I have modified the> userguide.example1.MyService to delay for about 10 seconds before> responding (leaving the 'echo' method). After packaging and deploying> the MyService.aar to Axis2, I run EchoNonBlockingDualClient> example...slightly modified to add a print statement within the while> loop...like so>>public static void main(String[] args) {>try { >OMElement payload = ClientUtil.getEchoOMElement();>>Options options = new Options();>options.setTo(targetEPR);>options.setTransportInProtocol (Constants.TRANSPORT_HTTP);>options.setUseSeparateListener(true);>>//Callback to handle the response>Callback callback = new Callback() {>public void onComplete(AsyncResult result) {>try {>StringWriter writer = new StringWriter();>> result.getResponseEnvelope().serialize(XMLOutputFactory.newInstance()>.createXMLStreamWriter(writer));>writer.flush ();>System.out.println(writer.toString());>>>} catch (XMLStreamException e) {>onError(e);>}>}>>public void onError(Exception e) {>e.printStackTrace();>}>};>>//Non-Blocking Invocation>ServiceClient sender = new ServiceClient(); >sender.setOptions(options);>sender.sendReceiveNonblocking(payload, callback);>>//Wait till the callback receives the response.>while (!callback.isComplete()) { >System.out.println("waiting...");>Thread.sleep(1000);>}>//Need to close the Client Side Listener.>> We I run it the code appears to block/wait at the > "sender.sendRecieveNonBlocking(...)" line for about 10 seconds. When> the program continues, I never see any print statements since the> "callback.isComplete()" is true by the time it gets to that point in > the code. The really bizarre part is that if I use> "options.setUseSeparateListener(false)"...the behavior is exactly what> I was originally expecting...I see several "waiting..." print > statements before the callback's onComplete is invoked. My> operational scenario requires a dual channel transport since my> webservice calls can be really long...therefore using a single two-way > transport (e.g., options.setUseSeparateListener(false)) is not a> viable option.>> Bottomline, I can't seem to get the two-way dual channel stuff> (EchoNonBlockingDualClient) to work for me. I must be missing > something obvious...but I don't see what it is. Any help would be> appreciated.>> Thanks,> Tony>>--Brian Shields BSc. MSc.,PhD Candidate,Department of Information Technology, National University of Ireland,Galway,Ireland.
Re: [Axis2] EchoNonBlockingDualClient problem
Tony, Apologies for jumping into this thread on an unrelated issue but i notice you have axis2 deployed on JBoss 4.0. I am about to undertake this task and was wondering if there was any resources on the web to help in it. I dont have a lot of experience with JBoss so not looking forward to it!! Regards, Brian Antony Wilson wrote: I have not been able to get the EchonNonBlockingDualClient example to work as described in the documentation. In my setup, I have Axis2 deployed to JBoss 4.0.3 and I have modified the userguide.example1.MyService to delay for about 10 seconds before responding (leaving the 'echo' method). After packaging and deploying the MyService.aar to Axis2, I run EchoNonBlockingDualClient example...slightly modified to add a print statement within the while loop...like so public static void main(String[] args) { try { OMElement payload = ClientUtil.getEchoOMElement(); Options options = new Options(); options.setTo(targetEPR); options.setTransportInProtocol(Constants.TRANSPORT_HTTP); options.setUseSeparateListener(true); //Callback to handle the response Callback callback = new Callback() { public void onComplete(AsyncResult result) { try { StringWriter writer = new StringWriter(); result.getResponseEnvelope().serialize(XMLOutputFactory.newInstance() .createXMLStreamWriter(writer)); writer.flush(); System.out.println(writer.toString()); } catch (XMLStreamException e) { onError(e); } } public void onError(Exception e) { e.printStackTrace(); } }; //Non-Blocking Invocation ServiceClient sender = new ServiceClient(); sender.setOptions(options); sender.sendReceiveNonblocking(payload, callback); //Wait till the callback receives the response. while (!callback.isComplete()) { System.out.println("waiting..."); Thread.sleep(1000); } //Need to close the Client Side Listener. We I run it the code appears to block/wait at the "sender.sendRecieveNonBlocking(...)" line for about 10 seconds. When the program continues, I never see any print statements since the "callback.isComplete()" is true by the time it gets to that point in the code. The really bizarre part is that if I use "options.setUseSeparateListener(false)"...the behavior is exactly what I was originally expecting...I see several "waiting..." print statements before the callback's onComplete is invoked. My operational scenario requires a dual channel transport since my webservice calls can be really long...therefore using a single two-way transport (e.g., options.setUseSeparateListener(false)) is not a viable option. Bottomline, I can't seem to get the two-way dual channel stuff (EchoNonBlockingDualClient) to work for me. I must be missing something obvious...but I don't see what it is. Any help would be appreciated. Thanks, Tony -- Brian Shields BSc. MSc., PhD Candidate, Department of Information Technology, National University of Ireland, Galway, Ireland.
[Axis2] EchoNonBlockingDualClient problem
I have not been able to get the EchonNonBlockingDualClient example to work as described in the documentation. In my setup, I have Axis2 deployed to JBoss 4.0.3 and I have modified the userguide.example1.MyService to delay for about 10 seconds before responding (leaving the 'echo' method). After packaging and deploying the MyService.aar to Axis2, I run EchoNonBlockingDualClient example...slightly modified to add a print statement within the while loop...like so public static void main(String[] args) { try { OMElement payload = ClientUtil.getEchoOMElement(); Options options = new Options(); options.setTo(targetEPR); options.setTransportInProtocol(Constants.TRANSPORT_HTTP); options.setUseSeparateListener(true); //Callback to handle the response Callback callback = new Callback() { public void onComplete(AsyncResult result) { try { StringWriter writer = new StringWriter(); result.getResponseEnvelope().serialize(XMLOutputFactory.newInstance() .createXMLStreamWriter(writer)); writer.flush(); System.out.println(writer.toString()); } catch (XMLStreamException e) { onError(e); } } public void onError(Exception e) { e.printStackTrace(); } }; //Non-Blocking Invocation ServiceClient sender = new ServiceClient(); sender.setOptions(options); sender.sendReceiveNonblocking(payload, callback); //Wait till the callback receives the response. while (!callback.isComplete()) { System.out.println("waiting..."); Thread.sleep(1000); } //Need to close the Client Side Listener. We I run it the code appears to block/wait at the "sender.sendRecieveNonBlocking(...)" line for about 10 seconds. When the program continues, I never see any print statements since the "callback.isComplete()" is true by the time it gets to that point in the code. The really bizarre part is that if I use "options.setUseSeparateListener(false)"...the behavior is exactly what I was originally expecting...I see several "waiting..." print statements before the callback's onComplete is invoked. My operational scenario requires a dual channel transport since my webservice calls can be really long...therefore using a single two-way transport (e.g., options.setUseSeparateListener(false)) is not a viable option. Bottomline, I can't seem to get the two-way dual channel stuff (EchoNonBlockingDualClient) to work for me. I must be missing something obvious...but I don't see what it is. Any help would be appreciated. Thanks, Tony