If you send an InOut to a component, whatever the component is, the response will be sent back to the consumer (the one that sent the exchange). This is what happen in your case. The xslt transformer can only forward exchange when you send an InOnly mep, in which case it will send the transformed message to the component configured with the destinationService attribute on the activationSpec.
To solve the problem, just configure the transformer as the first service of your routing slip: the transformed exchange will be sent to the next configured target. It seems this is what you did before. Have you tried the latest snapshots to solve the "Content is not allowed in Prolog" error ? If yes, could you send the log at debug level ? Cheers, Guillaume Nodet On 6/12/06, markpittsnh <[EMAIL PROTECTED]> wrote:
My goal is to incorporate a transformation inside of my slip-routing. But, since I am experiencing the "Content is not allowed in Prolog" error - similar to post ( http://www.nabble.com/org.xml.sax.SAXParseException%3A-Content-is-not-allowed-in-prolog-t1687645.html#a4579039 ), I decided to place the transformation outside of the routing for the time being. The payload I am passing to the httpconnector is... <typ:add xmlns:typ="http://MyCalc.server.simpleexample/types"> <param1>1</param1><param2>10</param2> </typ:add> As a test, I transform this, well actually my xslt replaces as.... <ser:simpleMethod xmlns:ser="http://server.simpleexample/"> <arg0>20</arg0> <arg1>2</arg1> </ser:simpleMethod> I expected the transformed XML to be passed into the routing, ultimately becoming the input to my SOAP call. Instead my HTML client, is receiving the transformed XML. Furthermore, it does not appear that the SOAP call is ever performed. See below for servicemix.xml and XSLT file. QN1: Why is message not moving onto the routing? Does this have to do with setting the appropriate MEP on the trnasformation compoenent? QN2: Why am I experiencing the 'org.xml.sax.SAXParseException: Content is not allowed in prolog" when incorporating the trnaformations inside of the routing? The snippet from servicemix.log follows... 12:06:01,657 | DEBUG | Thread-8 | SedaFlow | emix.jbi.nmr.flow.AbstractFlow 165 | Called Flow doRouting 12:06:01,657 | DEBUG | Thread-8 | DeliveryChannelImpl | .messaging.DeliveryChannelImpl 562 | Received: MessageExchange[ id: ID:markpxpr52-3409-1150128327875-2:0 status: Done role: provider service: transformer endpoint: transformer in: <?xml version="1.0" encoding="UTF-8"?><typ:add xmlns:typ="http://MyCalc.server.simpleexample/types"> <param1>1</param1><param2>10</param2> </typ:add> out: <?xml version="1.0" encoding="UTF-8"?><ser:simpleMethod xmlns:ser="http://server.simpleexample/" xmlns:my="http://servicemix.org/demo/ "><arg0>20</arg0><arg1>2</arg1></ser:simpleMethod> ] SERVICEMIX.XML <?xml version="1.0" encoding="UTF-8"?> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:eip="http://servicemix.apache.org/eip/1.0" xmlns:test="http://servicemix.apache.org/demo/"> <sm:container id="jbi" rootDir="./wdir" useMBeanServer="true" createMBeanServer="true" installationDirPath="./install" deploymentDirPath="./deploy" dumpStats="true" statsInterval="10" flowName="seda"> <sm:activationSpecs> <sm:activationSpec id="httpReceiver" service="test:httpBinding" endpoint="httpReceiver" destinationService="foo:transformer"> <sm:component> <bean class="org.apache.servicemix.components.http.HttpConnector"> <property name="host" value="localhost"/> <property name="port" value="8912"/> </bean> </sm:component> </sm:activationSpec> <sm:activationSpec id="servicemix-eip" > <sm:component> <eip:component> <eip:endpoints> <eip:static-routing-slip service="test:routingSlip" endpoint="endpoint"> <eip:targets> <eip:exchange-target service="foo:addIt2" /> <eip:exchange-target service="test:echo"/> </eip:targets> </eip:static-routing-slip> </eip:endpoints> </eip:component> </sm:component> </sm:activationSpec> <sm:activationSpec id="echo" service="test:echo" endpoint="endpoint"> <sm:component> <bean class="org.apache.servicemix.components.util.EchoComponent"/> </sm:component> </sm:activationSpec> <!-- This just invokes another service --> <sm:activationSpec componentName="divideIt" service="foo:divideIt" endpoint="divideIt"> <sm:component> <bean class="org.apache.servicemix.components.saaj.SaajBinding"> <property name="soapEndpoint"> <bean class="javax.xml.messaging.URLEndpoint"> <constructor-arg value="http://localhost:8081/jaxws-simpleexample/simplemethod"/> </bean> </property> </bean> </sm:component> </sm:activationSpec> <sm:activationSpec componentName="addIt2" service="foo:addIt2" endpoint="addIt2"> <sm:component> <bean class="org.apache.servicemix.components.saaj.SaajBinding"> <property name="soapEndpoint"> <bean class="javax.xml.messaging.URLEndpoint"> <constructor-arg value="http://localhost:8081/axis2/services/MyCalc"/> </bean> </property> </bean> </sm:component> </sm:activationSpec> <sm:activationSpec componentName="transformer" service="foo:transformer" destinationService="test:routingSlip"> <sm:component><bean class="org.apache.servicemix.components.xslt.XsltComponent"> <property name="xsltResource" value="fake_transform.xsl"/> </bean></sm:component> </sm:activationSpec> </sm:activationSpecs> </sm:container> </beans> XSLT <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:jbi="xalan://org.servicemix.components.xslt.XalanExtension" extension-element-prefixes="jbi" xmlns:my="http://servicemix.org/demo/" version="1.0"> <xsl:template match="/"> <ser:simpleMethod xmlns:ser="http://server.simpleexample/"> <arg0>20</arg0> <arg1>2</arg1> </ser:simpleMethod> </xsl:template> </xsl:stylesheet> Thanks and regards, Mark -- View this message in context: http://www.nabble.com/xslt-and-routing-t1775037.html#a4831662 Sent from the ServiceMix - User forum at Nabble.com.
