This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes Connection time out error while generating web service client using SAAJ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Connection time out error while generating web service client using SAAJ " Watch "Connection time out error while generating web service client using SAAJ " New topic
Author

Connection time out error while generating web service client using SAAJ

Amit Dewangan
Greenhorn

Joined: Apr 21, 2009
Posts: 2
Hi ,

I am trying to invoke webservice using SAAJ api client code. But while calling web service I am getting below error:
SEVERE: SAAJ0009: Message send failed
Error occurred while sending SOAP Request to Server
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:148)
at com.cgc.client.RemedySOAP.main(RemedySOAP.java:26)
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:279)
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:144)
... 1 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)


The problem is looks like due to proxy it is giving the connection time out error. I also set the proxy host in my code using AxisProperty.setProperty or System.setProperty method but still I am getting the sam error. Here is my code sample


// Create SOAP Connection
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection soapConnection = soapConnectionFactory.createConnection();
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", "snx1-cprx");
System.setProperty("http.proxyPort", "8080");

// Send SOAP Message to SOAP Server
URL url = new URL("https://capgroup80-dev.onbmc.com/arsys/services/ARService?server=onbmc-s&webService=HPD_IncidentInterface_Create_WS");
SOAPMessage soapResponse = soapConnection.call(createSOAPRequest(), url);


I also tried to invoke the webservice through Axis 1.4 . In axis 1.4 I am getting connection time out error after setting the proxy using AxisProperty.setProperty or System.setProperty .


Please help me out how to set proxy in SAAJ api
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection time out error while generating web service client using SAAJ