Currently, the XSLT component does not handle InOut MEPs when routing
exchanges.
You should use the ContentBasedRouter EIP pattern (
http://servicemix.goopen.org/site/servicemix-eip.html)
and use the XSLT for transformation only.
Cheers,
Guillaume Nodet
On 5/26/06, TimT <[EMAIL PROTECTED]> wrote:
Using Servicemix 2.0.2
I am having a problem configuring the XsltComponent to do routing. I am
getting a "Premature end of file." error.
My configuration connects a org.servicemix.components.http.HttpConnectorto
org.servicemix.components.xslt.XsltComponent, which then uses xslt and
jbi:forward to route the message to a webservice endpoint using a
SaajBinding component. An XML message is then posted into the
HttpConnector
and an XML response is expected back.
When the HttpConnector is connect directly to SaajBinding, the everything
goes well, but when using the router I get this error.
I have traced through and it seems that the HttpConnector creates a
StreamSource from the http request InputStream, and this is set into the
NormalizedMessages content. The xalan transformer used by the XsltCompoent
reads this InputStream and then closes it. Subsquently the onward
NormalisedMessage content is a StreamSource based on a closed stream, so
no
further processing is possible and the "Premature End of File" error is
thrown.
I have included my activations specs and XSLT, can anyone advise as to how
to fix/resolve this problem?
Regards,
Tim Tennant
<sm:activationSpec componentName="httpReceiver"
service="my:httpBinding"
endpoint="httpReceiver"
destinationService="my:router">
<sm:component>
<bean xmlns="http://xbean.org/schemas/spring/1.0"
class="org.servicemix.components.http.HttpConnector">
<property name="host" value="localhost" />
<property name="port" value="8912" />
</bean>
</sm:component>
</sm:activationSpec>
<sm:activationSpec componentName="router" service="my:router">
<sm:component>
<bean class="
org.servicemix.components.xslt.XsltComponent">
<property name="xsltResource"
value="classpath:my/esb/components/xslt/router.xsl" />
<!-- disable automatic output of
the result of the transform; only if
we perform
an invoke in the XSLT will
we invoke another endpoint -->
<property name="disableOutput"
value="true" />
</bean>
</sm:component>
</sm:activationSpec>
<sm:activationSpec componentName="search"
service="my:search"
endpoint="search">
<sm:component>
<bean xmlns="http://xbean.org/schemas/spring/1.0"
class="my.esb.components.saaj.SaajBinding">
<property name="soapEndpoint">
<bean class="
javax.xml.messaging.URLEndpoint">
<constructor-arg value="
http://localhost:6789/my.asmx"/>
</bean>
</property>
<property name="soapAction"
value="http://www.mywebservice.com/MySearch"/>
</bean>
</sm:component>
</sm:activationSpec>
XSLT
<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://my/esb/"
version="1.0">
<xsl:template match="/*">
<jbi:forward service="my:search" />
</xsl:template>
</xsl:stylesheet>
--
View this message in context:
http://www.nabble.com/XsltComponent+routing+problem-t1687094.html#a4577150
Sent from the ServiceMix - User forum at Nabble.com.