Iain, I have done a quick test based on the information you sent and it looks like the HTTP SOAP provider endpoint is sending the wrong information over the wire. It sends: POST /delayedstockquote/delayedstockquote.asmx HTTP/1.1 Host: ws.cdyne.com Content-Length: 282 (notice no SOAPAction or Content-Type in the request headers)
This makes the server respond with HTTP/1.1 415 Unsupported media type -- The server cannot service the request because the media type is unsupported. The body of the response starts with 'T' and that's why you're seeing this error message. It looks like you ran into https://issues.apache.org/activemq/browse/SMXCOMP-80. However, as a workaround: if you upgrade the CXF BC component to the 2009.01 version, it works with this configuration <cxfbc:provider wsdl="http://ws.cdyne.com/delayedstockquote/delayedstockquote.asmx?wsdl" locationURI="http://ws.cdyne.com/delayedstockquote/delayedstockquote.asmx" service="ce:DelayedStockQuote" endpoint="DelayedStockQuoteSoap" useJBIWrapper="false" useSOAPEnvelope="false"/> Regards, Gert Vanthienen ------------------------ Open Source SOA: http://fusesource.com Blog: http://gertvanthienen.blogspot.com/ 2009/5/6 Iain Soars <[email protected]>: > I am having issues using the soap-provider ServiceMix component in > ServiceMix 3.3 to connect to an external web service. I am building a > test case that is trying to connect to a public web service at > http://ws.cdyne.com/delayedstockquote/delayedstockquote.asmx?wsdl for > stock quotes. My xbean.xml looks like the following: > > > > <beans xmlns:http="http://servicemix.apache.org/http/1.0" > > xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0" > > xmlns:oms="urn:oms" > > xmlns="http://www.springframework.org/schema/beans" > > xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://servicemix.apache.org/http/1.0 > http://servicemix.apache.org/schema/servicemix-http-3.2.2.xsd > > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" > > xmlns:ce="http://ws.cdyne.com/"> > > > > <http:soap-provider > > service="ce:DelayedStockQuote" > > endpoint="DelayedStockQuoteSoap" > > > locationURI="http://ws.cdyne.com/delayedstockquote/delayedstockquote.asm > x" > > > wsdl="http://ws.cdyne.com/delayedstockquote/delayedstockquote.asmx?wsdl" > > validateWsdl="false" > > useJbiWrapper="false"> > > </http:soap-provider> > > </beans> > > > > I am using Camel to route the messages through to this endpoint, the > Camel that is involved is shown below: > > > > .to("xslt:transform.xsl") > > .to("log:test") > > .to("jbi:service:http://ws.cdyne.com//DelayedStockQuote?operation={http: > //ws.cdyne.com/}GetQuickQuote&mep=in-out").convertBodyTo(String.class) > > > > The XSLT file above creates the request XML - the transform is shown > below: > > > > <xsl:template match="/"> > > <xsl:element name="ws:GetQuickQuote" > namespace="http://ws.cdyne.com/"> > > <xsl:element > name="ws:StockSymbol" namespace="http://ws.cdyne.com/">GS</xsl:element> > > <xsl:element > name="ws:LicenceKey" namespace="http://ws.cdyne.com/">0</xsl:element> > > </xsl:element> > > </xsl:template> > > > > When I send this message to the endpoint I get the following error: > > > > org.apache.servicemix.soap.api.Fault: > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'T' > (code 84) in prolog; expected '<' > > > > The actual JBI information I see on the console is as follows: > > > > DEBUG - flow.seda.SedaQueue - > org.apache.servicemix.jbi.nmr.flow.seda.sedaqueu...@dc4bc dequeued > exchange: InOut[ > > id: ID:140.140.144.118-121160831af-3:5 > > status: Error > > role: consumer > > service: {http://ws.cdyne.com/}DelayedStockQuote > > endpoint: DelayedStockQuoteSoap > > operation: {http://ws.cdyne.com/}GetQuickQuote > > in: <?xml version="1.0" encoding="UTF-8"?><ws:GetQuickQuote > xmlns:ws="http://ws.cdyne.com/"> > > <ws:StockSymbol>GS</ws:StockSymbol> > > <ws:LicenceKey>0</ws:LicenceKey> > > </ws:GetQuickQuote> > > error: org.apache.servicemix.soap.api.Fault: > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'T' > (code 84) in prolog; expected '<' > > at [row,col {unknown-source}]: [1,1] > > ] > > > > Can anyone shed any light on why this error is occurring. I am able to > successfully connect to this web service through SoapUI and have copied > the XML request structure from there. I cannot find any simple example > of connecting to public web services using the new HTTP endpoints. I > have successfully used the old http endpoint, however this has an issue > with specifying the correct Content-Type header and therefore cannot be > used as the actual service I wish to connect to throws an error. > > > > Full stack trace of error below: > > > > org.apache.camel.RuntimeCamelException: > org.apache.servicemix.soap.api.Fault: > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'T' > (code 84) in prolog; expected '<' > > at [row,col {unknown-source}]: [1,1] > > at > org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelpe > r.java:724) > > at > org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endpoin > tMessageListener.java:81) > > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doInvo > keListener(AbstractMessageListenerContainer.java:531) > > at > org.springframework.jms.listener.AbstractMessageListenerContainer.invoke > Listener(AbstractMessageListenerContainer.java:466) > > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doExec > uteListener(AbstractMessageListenerContainer.java:435) > > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer > .doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322) > > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer > .receiveAndExecute(AbstractPollingMessageListenerContainer.java:260) > > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMe > ssageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java > :944) > > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMe > ssageListenerInvoker.run(DefaultMessageListenerContainer.java:875) > > at java.lang.Thread.run(Thread.java:619) > > Caused by: org.apache.servicemix.soap.api.Fault: > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'T' > (code 84) in prolog; expected '<' > > at [row,col {unknown-source}]: [1,1] > > at > org.apache.servicemix.soap.interceptors.xml.StaxInInterceptor.handleMess > age(StaxInInterceptor.java:64) > > at > org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseI > nterceptorChain.java:85) > > at > org.apache.servicemix.http.endpoints.HttpSoapProviderMarshaler.handleRes > ponse(HttpSoapProviderMarshaler.java:124) > > at > org.apache.servicemix.http.endpoints.HttpProviderEndpoint.handle(HttpPro > viderEndpoint.java:218) > > at > org.apache.servicemix.http.endpoints.HttpProviderEndpoint$Exchange.onRes > ponseComplete(HttpProviderEndpoint.java:317) > > at > org.mortbay.jetty.client.HttpExchange$Listener.onResponseComplete(HttpEx > change.java:563) > > at > org.mortbay.jetty.client.HttpExchange.setStatus(HttpExchange.java:164) > > at > org.mortbay.jetty.client.HttpConnection$Handler.messageComplete(HttpConn > ection.java:470) > > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:662) > > at > org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) > > at > org.mortbay.jetty.client.HttpConnection.handle(HttpConnection.java:254) > > at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: > 409) > > at > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java > :497) > > Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected > character 'T' (code 84) in prolog; expected '<' > > at [row,col {unknown-source}]: [1,1] > > at > com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623 > ) > > at > com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java: > 2047) > > at > com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069) > > at > javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.jav > a:60) > > at > org.apache.servicemix.soap.util.stax.ExtendedXMLStreamReader.next(Extend > edXMLStreamReader.java:61) > > at > org.apache.servicemix.soap.util.stax.ExtendedXMLStreamReader.nextTag(Ext > endedXMLStreamReader.java:44) > > at > org.apache.servicemix.soap.interceptors.xml.StaxInInterceptor.handleMess > age(StaxInInterceptor.java:61) > > ... 12 more > > WARN - jms.listener.DefaultMessageListenerContainer - Execution of JMS > message listener failed > > org.apache.camel.RuntimeCamelException: > org.apache.servicemix.soap.api.Fault: > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'T' > (code 84) in prolog; expected '<' > > at [row,col {unknown-source}]: [1,1] > > at > org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelpe > r.java:724) > > at > org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endpoin > tMessageListener.java:81) > > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doInvo > keListener(AbstractMessageListenerContainer.java:531) > > at > org.springframework.jms.listener.AbstractMessageListenerContainer.invoke > Listener(AbstractMessageListenerContainer.java:466) > > at > org.springframework.jms.listener.AbstractMessageListenerContainer.doExec > uteListener(AbstractMessageListenerContainer.java:435) > > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer > .doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322) > > at > org.springframework.jms.listener.AbstractPollingMessageListenerContainer > .receiveAndExecute(AbstractPollingMessageListenerContainer.java:260) > > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMe > ssageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java > :944) > > at > org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMe > ssageListenerInvoker.run(DefaultMessageListenerContainer.java:875) > > at java.lang.Thread.run(Thread.java:619) > > Caused by: org.apache.servicemix.soap.api.Fault: > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'T' > (code 84) in prolog; expected '<' > > at [row,col {unknown-source}]: [1,1] > > at > org.apache.servicemix.soap.interceptors.xml.StaxInInterceptor.handleMess > age(StaxInInterceptor.java:64) > > at > org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseI > nterceptorChain.java:85) > > at > org.apache.servicemix.http.endpoints.HttpSoapProviderMarshaler.handleRes > ponse(HttpSoapProviderMarshaler.java:124) > > at > org.apache.servicemix.http.endpoints.HttpProviderEndpoint.handle(HttpPro > viderEndpoint.java:218) > > at > org.apache.servicemix.http.endpoints.HttpProviderEndpoint$Exchange.onRes > ponseComplete(HttpProviderEndpoint.java:317) > > at > org.mortbay.jetty.client.HttpExchange$Listener.onResponseComplete(HttpEx > change.java:563) > > at > org.mortbay.jetty.client.HttpExchange.setStatus(HttpExchange.java:164) > > at > org.mortbay.jetty.client.HttpConnection$Handler.messageComplete(HttpConn > ection.java:470) > > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:662) > > at > org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) > > at > org.mortbay.jetty.client.HttpConnection.handle(HttpConnection.java:254) > > at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: > 409) > > at > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java > :497) > > Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected > character 'T' (code 84) in prolog; expected '<' > > at [row,col {unknown-source}]: [1,1] > > at > com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623 > ) > > at > com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java: > 2047) > > at > com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069) > > at > javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.jav > a:60) > > at > org.apache.servicemix.soap.util.stax.ExtendedXMLStreamReader.next(Extend > edXMLStreamReader.java:61) > > at > org.apache.servicemix.soap.util.stax.ExtendedXMLStreamReader.nextTag(Ext > endedXMLStreamReader.java:44) > > at > org.apache.servicemix.soap.interceptors.xml.StaxInInterceptor.handleMess > age(StaxInInterceptor.java:61) > > ... 12 more > > > > > > Thanks > > Iain > > > > > > Iain Soars > > Senior Consultant > > The Ultimate People Company (UPCO) > > 1 Crown Sq, Woking, Surrey, GU21 6HR > > Tel: 01483 215132 > > Email: [email protected] <mailto:[email protected]> > > Web: www.upco.co.uk <http://www.upco.co.uk> > >
