You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Alan Zhang <al...@yahoo.com> on 2011/01/25 23:32:29 UTC

Beginner's question: Poller > Xlst > Sender

I am new to ServiceMix and try to run a simple example as file poller > Xlst
> file sender
I have xbean.xml as
    <file:poller service="test:file-poller" endpoint="file-poller"
        targetService="test:xslt"
        targetEndpoint="xslt" 
        file="file:///c:/test/pool">
and
  <saxon:xslt service="test:xslt" endpoint="xslt"
              resource="classpath:bridge.xsl" /> 

but get error like
WARN  - FileComponent                  - Message in file
c:\test\pool\test.xml could not be handled successfully: Unsupported MEP:
http://www.w3.org/2004/08/wsdl/in-only
java.lang.UnsupportedOperationException: Unsupported MEP:
http://www.w3.org/2004
/08/wsdl/in-only

What's the right way to use these components and can anyone give a working
example?


-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Beginner-s-question-Poller-Xlst-Sender-tp3357111p3357111.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Beginner's question: Poller > Xlst > Sender

Posted by michaeljessup <mi...@gmail.com>.
Indeed, you cleared up every questions that I need. As a beginner, I would
like to know this information as well. Thanks for sharing this great
information.

-----
http://www.positioningforprofits.com Curtis Johnson Realty 
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Beginner-s-question-Poller-Xlst-Sender-tp3357111p3364347.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Beginner's question: Poller > Xlst > Sender

Posted by Geert Schuring <ge...@schuring.eu>.
Hey Alan,

First of all, welcome to the ServiceMix community!

About your question:
JBI Components like servicemix-file and servicemix-saxon support a subset
of all available exchange patterns. See
http://www.w3.org/TR/2006/CR-wsdl20-adjuncts-20060327/#meps

The file component supports the Out-Only MEP and nothing else. After
reading a file and sending it to the NMR, there is not much a file poller
can do with any reply, is there? This means that the saxon component
receives an In-Only MEP exchange. But saxon does not support the In-Only
MEP because its sole purpose is to transform and return messages. What's
the point of transforming a message if you can't send the result to
anyone?

You need a 3rd component that will route the message from the file-poller
to the xslt transformer, and then route the result to a file-sender.
Originally the servicemix-eip (Enterprise Integration Patterns) component
was used for that, but after Camel became a widely adopted message router
the servicemix-eip component was deprecated and replaced with
servicemix-camel. There is an active community around Camel so getting
help in that area should be no problem.

See:
http://servicemix.apache.org/SM/servicemix-camel.html
http://camel.apache.org/how-does-camel-compare-to-servicemix-eip.html
http://camel.apache.org/jbi.html

To get you started: You have to create a camel router endpoint, and
configure the file-poller to send its files to the camel endpoint. The
camel endpoint will then send the message to the saxon endpoint, receive
the result, and send it to the file-sender.

Good luck, and let me know if you run into trouble.

Kind regards,
Geert Schuring.

> I am new to ServiceMix and try to run a simple example as file poller >
> Xlst
>> file sender
> I have xbean.xml as
>     <file:poller service="test:file-poller" endpoint="file-poller"
>         targetService="test:xslt"
>         targetEndpoint="xslt"
>         file="file:///c:/test/pool">
> and
>   <saxon:xslt service="test:xslt" endpoint="xslt"
>               resource="classpath:bridge.xsl" />
>
> but get error like
> WARN  - FileComponent                  - Message in file
> c:\test\pool\test.xml could not be handled successfully: Unsupported MEP:
> http://www.w3.org/2004/08/wsdl/in-only
> java.lang.UnsupportedOperationException: Unsupported MEP:
> http://www.w3.org/2004
> /08/wsdl/in-only
>
> What's the right way to use these components and can anyone give a working
> example?
>
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/Beginner-s-question-Poller-Xlst-Sender-tp3357111p3357111.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
>



Re: Beginner's question: Poller > Xlst > Sender

Posted by Alan Zhang <al...@yahoo.com>.
Thanks Geert! It works like a charm.

We have a trivial integration requirement here but in future we may expand
the ESB implementation.  So I am evealuting a few ESB products now.  The
currently requirement is 
1. App A output xml
2. transform xml
3. ftp to a location and then consumed by legacy app B.
4. App B outputs a file to a place
5. ftp poll the file
6. transform
7. feed back to App A

Besides the simple flow, to implement it as a robust application in
servicemix, any suggestion or best practice I should follow. e.g. logging,
error handling, retry logic etc. Thanks.
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Beginner-s-question-Poller-Xlst-Sender-tp3357111p3358254.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.