Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Soap connection in java issue

Options
  • 05-10-2012 3:06pm
    #1
    Closed Accounts Posts: 2,630 ✭✭✭


    Hey

    Im having a bit of a problem trying to get a soap client working.

    I want to hit a site, and can do so using POSTER in firefox.

    but my code doesnt work:
    //host = WSDL location
    public static SOAPMessage sendPOSTMessage( String host, SOAPMessage message ) {
            SOAPMessage response = null ;
            try {
                SOAPConnectionFactory sfc = SOAPConnectionFactory.newInstance();
                SOAPConnection connection = sfc.createConnection();
    
                URL endpoint = new URL(host) ;
                response = connection.call(message, endpoint);
            } catch (SOAPException|MalformedURLException e) {
                e.printStackTrace();  
            }
            return response ;
        }
    
    

    this keeps returning a
    Oct 05, 2012 2:53:10 PM com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection post
    SEVERE: SAAJ0009: Message send failed.....
    .....
    Caused by: java.net.ConnectException: Connection timed out: connect
    

    exception.

    I've looked into my Firewall settings, checking the response manually, and dont know why this isnt working.

    Can anyone point me in the right direction?


Comments

  • Registered Users Posts: 4,766 ✭✭✭cython


    Have you tried connecting a debugger, or printing the content of the host string before attempting the call, in case the value is something other than what you expect? I would wonder if perhaps the wrong port or something is specified if it's timing out...


Advertisement