As you are just print the return value of main, I don't think you can result of 
script when it is ran.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Friday, December 14, 2012 at 6:19 AM, neilac333 wrote:

> I have a Python script that is an endpoint along a route as follows:
>  
> <route>
> <from uri="servlet:///test-python"/>
> <to uri="language:python:classpath:file.py" />
> <to uri="bean:dataProvider"/>
> <marshal ref="jsonBuilder"/>
> </route>
>  
> All the Python script does is return a string that should be the message
> body for the next component (dataProvider):
>  
> def main():
> return "hello"
>  
> if __name__ == "__main__":
> print main()
>  
> So I want "hello" to be passed along to dataProvider.
>  
> Instead, I am getting a NPE because the return value from the Python script
> is in fact not being passed as a message.
>  
> Any insight into how to accomplish this is appreciated.
>  
> Thanks.
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Return-Value-from-Python-Script-Not-In-Message-Body-tp5724056.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).



Reply via email to