Hi Bruce,

If you already has the request message from the file endpoint, you just
need to use http endpoint to call the external web service like this.

<camelContext xmlns="http://activemq.apache.org/camel/schema/spring";>
     <package>com.mycompany.camel</package>
     <route>
       <from uri="file:src/data?noop=true"/>
       <to uri="http://localhost:9002/HelloWorld"/>
     </route>
</camelContext>

Willem

Bruce Snyder wrote:
> I'm creating a simple example of using Camel 1.6 with web services
> using the java_first_spring_support service that comes with CXF. I
> have a XML schema and a Java API of the same service. Both were
> created using the Maven archetypes and are being executed via the
> camel:run plugin and each is having different issues:
> 
> 1) Below is the XML schema-based config of the Camel context:
> 
> <camelContext xmlns="http://activemq.apache.org/camel/schema/spring";>
>     <package>com.mycompany.camel</package>
>     <route>
>       <from uri="file:src/data?noop=true"/>
>       <to 
> uri="cxf:http://localhost:9002/HelloWorld?serviceClass=demo.spring.HelloWorld"/>
>     </route>
>   </camelContext>
> 
> The problem with this flavor is the following error:
> 
> org.apache.camel.RuntimeCamelException: Can't find the operation name
> in the message!
> 
> To my knowledge, there is no way to add headers to a message exchange
> via the XML. If I'm wrong about this I'd appreciate some suggestions
> on how to get beyond the error.
> 
> 
> 2) Below is the same route using the Java API:
> 
>     public void configure() {
>               from("file:src/data?noop=true").process(new Processor() {
>             public void process(Exchange exchange) throws Exception {
>                 Message in = exchange.getIn();
>                 in.setHeader("operationName", "sayHi");
>             }
>               }).
>               
> to("cxf:http://localhost:9002/HelloWorld?serviceClass=demo.spring.HelloWorld";);
>       }
> 
> The problem with this route is that Camel hangs on the following line
> indefinitely and I can't get it beyond it:
> 
> ...
> INFO: Apache Camel 1.6.0 (CamelContext:camelContext) started
> Mar 4, 2009 2:01:06 PM org.apache.camel.util.MainSupport generateDot
> INFO: Generating DOT file for routes:
> /Users/bsnyder/Desktop/eclipse-3.4/workspace-amq-trunk/camel-example-two/target/site/cameldoc
> for: org.apache.camel.spring.springcamelcont...@dd6a83 with name:
> camelContext
> 
> If anyone can tell me how to move beyond this then I could move on to
> the next issue.
> 
> Incidentally, patched the org.apache.camel.spring.Main class to add
> the ability to disable the DOT file generation. But there is already a
> property in the RunMojo named dotEnabled but it's read-only. Why is
> this?
> 
> Additionally, I've enabled debug logging on org.apache.camel and I'm
> still only seeing info level output, even after cleaning and
> rebuilding.
> 
> Bruce

Reply via email to