Made another test with soap="true" and passing just the xml content (the exact same request found in http://www.nabble.com/file/3876/request.xml %SERVICEMIX_HOME%/examples/http-binding/request.xml ) as you suggested, but HTTP/1.1 500 Internal Server Error with a soap fault is returned instead (see http://www.nabble.com/file/3878/http-provider-soap-true.txt http-provider-soap-true.txt ).
If instead I use the SaajBinding component (see http://www.nabble.com/file/3877/spring.xml spring.xml ) everything works as expected (see http://www.nabble.com/file/3879/saaj-binding.txt saaj-binding.txt ). Here is the HTTP header sent by the http component with soap="true": POST /soap HTTP/1.1 Content-Type: text/xml Content-Length: 423 SOAPAction: "" User-Agent: Jakarta Commons-HttpClient/3.0 Host: 64.124.140.30:9090 Here is the HTTP header sent by the SaajBinding component: POST /soap HTTP/1.0 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: Axis/1.3 Host: 64.124.140.30:9090 Cache-Control: no-cache Pragma: no-cache SOAPAction: """" Content-Length: 555 Also when using http component, the soap envelope sent: <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> With SaajBinding: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> The request sent in http://www.nabble.com/file/3876/request.xml request.xml : <ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:se="http://schemas.xmlsoap.org/soap/envelope/" se:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <symbol xsi:type="xsd:string">IBM</symbol> </ns1:getQuote> Any idea? Thanks! gnodet wrote: > > The problem may come from a missing SOAPAction http header. > The best way would be to use a soap="true" and let servicemix-http > handle the soap envelope stuff: you just need to pass the xml content > instead of the full soap request: > <ns0:getQuote xmlns:ns0="urn:xmethods-delayed-quotes" > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> > <symbol xsi:type="xsd:string">IBM</symbol> > </ns0:getQuote> > > On 10/25/06, spelletier <[EMAIL PROTECTED]> wrote: >> >> Here is a very simple test for the servicemix-http component, when >> running it >> I get a org.apache.commons.httpclient.NoHttpResponseException: The server >> 64.124.140.30 failed to respond. >> >> public void test() >> throws Exception >> { >> DefaultServiceMixClient client = new >> DefaultServiceMixClient(jbi); >> InOut me = client.createInOutExchange(); >> me.setService(new QName("http://test", "MyProviderService")); >> me.getInMessage().setContent(new >> StreamSource(getClass().getResourceAsStream("request.xml"))); >> client.sendSync(me); >> if (me.getStatus() == ExchangeStatus.ERROR) { >> if (me.getFault() != null) { >> fail("Received fault: " + new >> SourceTransformer().toString(me.getFault().getContent())); >> } else if (me.getError() != null) { >> throw me.getError(); >> } else { >> fail("Received ERROR status"); >> } >> } else { >> logger.info(new >> SourceTransformer().toString(me.getOutMessage().getContent())); >> } >> } >> >> protected AbstractXmlApplicationContext createBeanFactory() >> { >> return new ClassPathXmlApplicationContext("spring.xml"); >> } >> >> What I tried was simply to define one http endpoint in spring.xml that is >> configured to call the stock quote web service at >> http://64.124.140.30:9090/soap (the web service used in ServiceMix >> examples). >> >> When I try it in Eclipse's Web Services Explorer it works fine, the stock >> quote web service correctly returns the quote. In eclipse.txt (in >> attachment) there is the TCP stream reconstruction from the packet >> capture >> using Wireshark (Ethereal), in which we can see that the server responded >> with HTTP/1.1 200 OK. I then copy/pasted from eclipse.txt the captured >> soap >> request into request.xml to try it with the http binding of ServiceMix. >> The >> packet capture for the test with ServiceMix is in >> servicemix-http_soap-false.txt. The same soap envelope was sent, but >> this >> time no response. The only thing that looks different between Eclipse >> and >> ServiceMix is the http-header. >> >> What is also interesting is that if I configure in spring.xml the http >> endpoint with soap="true", the soap request sent is (obviously) a bad >> request (2 soap envelopes, 2 <soapenv:Body>), but now the server respond >> with a soap Fault and HTTP/1.1 500 Internal Server Error instead of not >> answering anything. The packet capture (tcp stream reconstruction) for >> the >> test with soap="true" is in bad-soap-request.txt. >> >> Any idea what I'm doing wrong? >> >> Thanks! >> >> http://www.nabble.com/file/3829/eclipse.txt eclipse.txt , >> http://www.nabble.com/file/3830/servicemix-http_soap-false.txt >> servicemix-http_soap-false.txt , >> http://www.nabble.com/file/3831/bad-soap-request.txt bad-soap-request.txt >> , >> http://www.nabble.com/file/3832/spring.xml spring.xml , >> http://www.nabble.com/file/3833/request.xml request.xml >> -- >> View this message in context: >> http://www.nabble.com/NoHttpResponseException-in-servicemix-http-tf2505661.html#a6986059 >> Sent from the ServiceMix - User mailing list archive at Nabble.com. >> >> > > > -- > Cheers, > Guillaume Nodet > > -- View this message in context: http://www.nabble.com/NoHttpResponseException-in-servicemix-http-tf2505661.html#a7035343 Sent from the ServiceMix - User mailing list archive at Nabble.com.
