camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <bruce.sny...@gmail.com>
Subject Invoking web services with Camel Using CXF
Date Wed, 04 Mar 2009 21:42:05 GMT
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.SpringCamelContext@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
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.apache.org/
Apache Camel - http://camel.apache.org/
Apache ServiceMix - http://servicemix.apache.org/

Blog: http://bruceblog.org/

Mime
View raw message