• 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.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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!