Hi, I'm trying to call an webservice with a simple SoapMessageRequest. 
This is the scenario:
In my application I receive one request to a service from the browser, then
I get the configuration of that service (host,port,etc...) from the DB, and
then I need to construct my request to a blackbox that i can't control. 
This is my Soaprequest:
                
try {
                      SOAPConnectionFactory sfc = 
SOAPConnectionFactory.newInstance();
                      SOAPConnection connection = sfc.createConnection();

                      MessageFactory mf = MessageFactory.newInstance();
                      SOAPMessage sm = mf.createMessage();

                      SOAPHeader sh = sm.getSOAPHeader();
                      sm.getSOAPBody().setTextContent("THIS IS THE BODY");
                      
                      System.out.println("\n Soap Request:\n");
                      sm.writeTo(System.out);
                      System.out.println();
                      
                      URL endpoint = new 
URL(protocol+"://"+host+":"+port+"/"+service);
                      SOAPMessage response = connection.call(sm, endpoint);
                      
System.out.println("RESPONSE"+response.getContentDescription());
                    } catch (Exception ex) {
                      ex.printStackTrace();
                    }


But when I send the message this error occurs :
SEVERE: SAAJ0008: Bad Response; Not Found
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl:
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Bad response: (404Not
Found



What I'm doing wrong? Or if someone knows one best way to do what I want,
please tell me.. :P

thanks...

--
View this message in context: 
http://cxf.547215.n5.nabble.com/call-webservice-with-a-simple-SoapRequest-tp4935529p4935529.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to