Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

first steps with very simple SOAP: SAAJ0009: Message send failed

843833Jun 24 2008 — edited Apr 30 2009
Hi,

I've searched thru this list, and although the issue has come up here and there, I can't find a satisfactory answer/solution to my problem.

I'm trying to create my very first SAAJ-based SOAP client, setting the body contents according to the books, and I end up with the following error message:

24-jun-2008 16:27:14 com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection post
SEVERE: SAAJ0009: Message send failed

The stacktrace, by its almost emptyness, doesn't give me any further clues on where to look at first...

Here is the bit of code causing my misery:
        // Construct the message
        MessageFactory factory = MessageFactory.newInstance(); 
        SOAPMessage message = factory.createMessage(); 
        
        // no need for a header here. 
        message.getSOAPHeader().detachNode(); 
        
        SOAPBody body = message.getSOAPBody(); 
        //QName bodyName = new QName("http://www.webserviceX.NET", "GetICD9CodeResponse");
        
        QName bodyName = new QName("http://www.webserviceX.NET", "GetCitiesByCountry");
        SOAPBodyElement bodyElement = body.addBodyElement(bodyName); 
        QName name = new QName("CountryName");
        SOAPElement queryString = bodyElement.addChildElement(name); 
        queryString.addTextNode(code); 
        
        message.writeTo(System.out);
        // Construct the connection 
        SOAPConnectionFactory connFactory = SOAPConnectionFactory.newInstance(); 
        SOAPConnection connection = connFactory.createConnection(); 
        
        // Send that bloody message
        
        SOAPMessage response = connection.call(message, "http://www.webserviceX.NET");
Should I have some specific properties set for the thing to work? Am I missing libraries? How about setting any proxies?

Looking forward to some help...
Fiikske
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2009
Added on Jun 24 2008
5 comments
5,629 views