You can use
1. servicemix-cxf-bc consumer, the flow is like
cxfbc:consumer can expose a SOAP webservice
2. use camel-cxf, something like
camel-cxf can also expose a SOAP webservice
in both case you need provide a wsdl, which can specify what your soap message should be.
Or easier, to expose a bean as a webservice can I use camel-cxf ?
But the WSDL can't be generated by Servicemix ?
Ok I followed the cxf-wsdl-first-osgi-package example ( http://repo1.maven.org/maven2/org/apache/servicemix/examples/cxf-wsdl-first-osgi-package/)
It works well, I can send SOAP requests to my bundle.
But my idea is to get the message sent by a SOAP client with camel.
So I made an interceptor:
But it doesn't work ? Nothing happend into the log when I send a SOAP request...
Did I forget something ??
Or the reverse way, from my PersonImpl, send the message request to a ActiveMQ queue
I succeed to make a web service
I'm just trying to link a web service implementation with a JMS queue
There is also this fairly simple CXF examples at Apache
And a new example about OSGi when using HTTP service (requires Camel 2.8)
They expose a web service using Camel in a route. Then you can route that to eg a JMS queue instead.
Thanks a lot for the links it was very helpful
But I still have a last problem:
In my PersonImpl (which is called when a SOAP request is sent), I'd like to access to a Camel endpoint with:
JndiContext context = new JndiContext();
CamelContext camelContext = new DefaultCamelContext(context);
org.apache.camel.Endpoint endpoint = camelContext.getEndpoint("activemq:queue/myQueue");
But I get a: Exception:org.apache.camel.RuntimeCamelException: org.apache.camel.TypeConverterLoaderException: Failed to load type converters because of: Cannot find any type converter classes from the following packages: org.apache.camel.component.file, org.apache.camel.component.bean, org.apache.camel.converter
Edited by: manta7 on Apr 22, 2011 12:43 PM
I'm not sure it's a good idea to explicitly init camel context in PersonImpl which is from cxf se endpoint, ideally you should use pure camel DSL to manage your router.
This exception generally means you didn't install necessary camel feature(camel-activemq for your case) or your cxf se bundle didn't import necessary camel component package.
Ok I see...
But if I don't init my camel context in the PersonImpl, how can I reach an camel endpoint from PersonImpl ?
And it's weird cause I have the activemq-camel dependency in my pom.xml, and I just have a central bundle which contains also the cxfse xml configuration
I just see that it's the camelContext.start() which failed
Edited by: manta7 on Apr 22, 2011 2:22 PM
I think your working flow is wrong here. Do you really need a cxf se endpoint?
cxf se endpoint basically just process the business logic inside ESB.
The easiest way for you is use camel-cxf endpoint to receive external client request and then in camel router you can use camel-activemq endpoint to send to a queue.
So all router should be in from().to() style.
Have activemq-camel dependency in your pom.xml doesn't mean the activemq-camel feature bundles already installed in the OSGi container.
You need do
Sorry for all the questions but I'm a little bit lost.. (and thanks for the answers!)
This is my configuration:
<cxfbc:consumer wsdl="classpath:person.wsdl" endpoint="soap" targetService="person:PersonService" targetInterface="person:Person">
<bean class="org.apache.servicemix.samples.wsdl_first.PersonImpl" />
I didn't find how I could route the client-soap-request with camel..
I tried with cxf:bean:hello and others but it don't works