Hey Daniel,

      Yes I'm using the same example. What I did in order to test this
out was I changed the SmooksDataFormat class to return StreamSource
instead of StringResult. It's not a permanent solution but right now
I'm just trying to learn about these things.

      Now the converter example will probably work. I wasn't able to
test it because I'm having some trouble with my machine right now. I
wasn't able to look deeper into the string conversion either. But the
question is should users really have to do one of these conversions ?
Isn't this something that Camel or Servicemix has to handle ? I mean
it doesn't seem exactly intuitive that these conversions are required.


thanks for all the help,
Sorin.


On Wed, Aug 25, 2010 at 9:19 PM, Daniel Bevenius
<daniel.beven...@gmail.com> wrote:
> Hey Sorin,
>
> that looks correct to me and this should work as we provide a converter from
> StringResult to String.
>  We've also added a converter now that can convert directly from
> StringResult to a StreamSource which you could try but since the String did
> not work I don't expect that will.
> Could you add a log element that logs the result of the formatter too:
> <log message="After SmooksDataFormat: ${body}"/>
>
> Are you using the same example that you posted previously to the Smooks user
> list? If not, could you send me an updated version and I'll try this out
> tomorrow.
>
> Regards,
>
> /Daniel
>
> Can you try adding a log element to the route make sure the Smooks
>
> 2010/8/25 Sorin Silaghi <sorin7...@gmail.com>
>
>> Pardon my ignorance but do you mean like this:
>>
>>            <route>
>>              <from
>> uri="jbi:endpoint:
>> http://servicemix.apache.org/samples/bridge/marshaled/edi-endpoint"/>
>>              <unmarshal ref="myEdifact"/>
>>               <convertBodyTo type="java.lang.String"/>
>>               <to
>> uri="nmr:{http://servicemix.apache.org/samples/bridge}ftp:sender"/>
>>            </route>
>>
>> because that doesn't work.
>>
>>
>>
>> On Wed, Aug 25, 2010 at 5:47 PM, Claus Ibsen <claus.ib...@gmail.com>
>> wrote:
>> > You can most likely just convert to String before sending to NMR
>> >     <convertBodyTo type="String"/>
>> >
>> >
>> >
>> >
>> > On Wed, Aug 25, 2010 at 4:22 PM, Sorin Silaghi <sorin7...@gmail.com>
>> wrote:
>> >> Hello,
>> >>
>> >>
>> >>       I've been trying out the camel-integration component that
>> >> Daniel Bevenius started from the Smooks project. If you don't know
>> >> about it here's where you can find it:
>> >> https://svn.codehaus.org/milyn/workspaces/tfennelly/camel-integration
>> >>
>> >>       The problem I had is it didn't work in Servicemix with the ftp
>> >> endpoint. It seems that the problem was with the object type that was
>> >> returned by the unmarshal method in SmooksDataFormat. What Smooks
>> >> normally returns is an implementation of javax.xml.transform.Result
>> >> and what was needed is javax.xml.transform.stream.StreamSource.
>> >>
>> >>       So my question is where should this type conversion take place
>> >> exactly? I'm not that familiar with Camel or Servicemix. I thought I'd
>> >> send this to the Camel mailing list because the problem is related to
>> >> this camel-integration component but let me know if I have to move
>> >> this to the Servicemix mailing list.
>> >>
>> >>       Bellow is the content of my camel-context.xml file:
>> >>
>> >>        <bean id="myEdifact"
>> >> class="org.milyn.smooks.camel.dataformat.SmooksDataFormat2">
>> >>
>>  <constructor-arg><value>file:/home/sorin/work/EDIGrid/apache-servicemix-4.2.0/etc/smooks-config.xml</value></constructor-arg>
>> >>
>>  <constructor-arg><value>org.milyn.payload.StringResult</value></constructor-arg>
>> >>          <constructor-arg><value>result</value></constructor-arg>
>> >>        </bean>
>> >>
>> >>        <camelContext xmlns="http://camel.apache.org/schema/spring";>
>> >>          <route>
>> >>              <from
>> >> uri="jbi:endpoint:
>> http://servicemix.apache.org/samples/bridge/marshaled/edi-endpoint"/>
>> >>              <unmarshal ref="myEdifact"/>
>> >>              <to
>> >> uri="nmr:{http://servicemix.apache.org/samples/bridge}ftp:sender"/>
>> >>          </route>
>> >>        </camelContext>
>> >>
>> >>
>> >> thank you,
>> >>                Sorin.
>> >>
>> >
>> >
>> >
>> > --
>> > Claus Ibsen
>> > Apache Camel Committer
>> >
>> > Author of Camel in Action: http://www.manning.com/ibsen/
>> > Open Source Integration: http://fusesource.com
>> > Blog: http://davsclaus.blogspot.com/
>> > Twitter: http://twitter.com/davsclaus
>> >
>>
>

Reply via email to