Hello all,

First I should say that I am using ServiceMix 4, deploying my applications
as OSGI bundles. 

I have a properly working service engine that is a CXF web service that has
request/reply methods. I have it exposed with the following spring beans
configuration:

    <cxfse:endpoint id="customerServiceSE"
                service="example:customerService"
                endpoint="endpoint">
        <cxfse:pojo>
          <bean
class="com.srcinc.purchase_order.customer.service.CustomerServicePortTypeImpl">
              <constructor-arg>
                  <ref bean="entityManagerFactory"/>
              </constructor-arg>    
          </bean>
        </cxfse:pojo>
    </cxfse:endpoint>

I have the service engine exposed to the  outside world (outside of the ESB)
with a binding component. Following is the spring beans configuration for
that:

        <cxfbc:consumer wsdl="classpath:wsdl/CustomerService.wsdl"
                targetService="example:customerService"
                targetEndpoint="endpoint"/>

Both the service engine and binding component are deployed as OSGI bundles.

I can call it using SoapUI (a client) passing any needed arguments and have
it return with the reply.

Now I am trying to add a Camel routing bundle as part of the application. I
want to still be able to call the web service from a client like I am and
have it work as it is but I also want to grab the SOAP content of the
incoming call (from the web service) and route it somewhere else as well.

I am extending the RouteBuilder class, overriding the configure method as
follows:

    public void configure() {
         LOG.info("PurchaseOrderRouter configure me");
        
from("jbi:endpoint:http://purchase_order.srcinc.com/customerService/endpoint?mep=in-out";)
      .convertBodyTo(String.class)
      .to(toUri);                
    }

The following still allows me to use my web service. I believe the
from("jbi:endpoint:http://purchase_order.srcinc.com/customerService/endpoint?mep=in-out";)
part works (thanks Freeman for pointing me in the right direction!). 

I am trying to figure out how to set this up so the web service call works
like it is but I also want to extract the contents of the incoming call,
turn it into a string (ie, convertBody(String.class) and send it off to 
another URI. 

In the above example the "convertBody" and "to" have no effect. Can anyone
tell me how I can use Camel to extract the incoming content from the
{from("jbi:endpoint:http://purchase_order.srcinc.com/customerService/endpoint?mep=in-out";)}
call and route it like I want to?

Thanks!
-- 
View this message in context: 
http://old.nabble.com/Camel-Router-to-a-Web-Service-%28InOut%29-tp28028457p28028457.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to