This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection time out error while generating web service client using SAAJ

Amit Dewangan
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.cgc.client.RemedySOAP.main(
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
... 1 more
Caused by: Connection timed out: connect
at 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("");
SOAPMessage soapResponse =, 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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic