You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Zhemzhitsky Sergey <Se...@troika.ru> on 2011/04/26 08:51:26 UTC

Camel: SOAP over JMS

Hi there,

I'm trying to configure SOAP over JMS by means of camel, cfx, activemq and servicemix (apache-servicemix-4.3.1-fuse-01-09).

Here is documentation http://camel.apache.org/camel-transport-for-cxf.html I'm using.

My configuration file looks like this

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:cxf="http://camel.apache.org/schema/cxf"
    xmlns:jaxws="http://cxf.apache.org/jaxws"
    xmlns:soap="http://cxf.apache.org/bindings/soap"
    xmlns:echo="http://www.springframework.org/spring-ws/samples/echo"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
    ">

    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />

    <bean class="org.apache.camel.component.cxf.transport.CamelTransportFactory">
        <property name="bus" ref="cxf" />
        <property name="camelContext" ref="camel" />
        <property name="transportIds">
            <list>
                <value>http://cxf.apache.org/transports/camel</value>
            </list>
        </property>
    </bean>

    <cxf:cxfEndpoint id="echoService" address="camel:activemq:queue:EchoRequest"
        endpointName="echo:EchoSoap11" serviceName="echo:EchoService" wsdlURL="echo.wsdl">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD" />
        </cxf:properties>
    </cxf:cxfEndpoint>

    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="file:c:/workspace/temp/cxf/req" />
            <inOut uri="activemq:queue:EchoRequest?jmsMessageType=Bytes&amp;replyTo=EchoReply&amp;useMessageIDAsCorrelationID=true"/>
            <to uri="log:org.testapp?level=INFO" />
            <to uri="file:c:/workspace/temp/cxf/resp"/>
        </route>
    </camelContext>

    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="brokerURL" value="tcp://localhost:61616"/>
    </bean>

</beans>

From the configuration - I'm trying to invoke CXF services when sending messages to activemq. Messages are SOAP payloads and look like this

<echo:echoRequest xmlns:echo="http://www.springframework.org/spring-ws/samples/echo">hello</echo:echoRequest>

I'm expecting the payload to become a SOAP envelope

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:echo="http://www.springframework.org/spring-ws/samples/echo">
   <soapenv:Header/>
   <soapenv:Body>
      <echo:echoRequest>hello</echo:echoRequest>
   </soapenv:Body>
</soapenv:Envelope>

But it does not happen and there is only payload in the queue and it seems that CXF is not attached to the acvivemq endpoint.

So the question is how to configure cxf+camel+activemq in the apache-servicemix-4.3.1-fuse-01-09 to create a fully functional SOAP envelope when sending only a payload into the queue?


Best Regards,
Sergey Zhemzhitsky


_______________________________________________________

The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. 
If you need assistance please contact our Contact Center  (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp  


RE: Camel: SOAP over JMS

Posted by Zhemzhitsky Sergey <Se...@troika.ru>.
Hello Christian,

Thanks for help.

Finally I understood that I was slightly incorrect trying to bind a cxf service to an activemq endpoint so I have used cxf-jms transport. 

Moreover it seems that it's hardly possible to bind <cxf:cxfEndpoint xmlns:cxf="http://camel.apache.org/schema/cxf" ... /> to a direct endpoint or any other endpoint for now.
The Definition of the endpoint was

    <cxf:cxfEndpoint id="echoService" address="camel://direct:test" serviceClass="org.springframework.spring_ws.samples.echo.Echo"
        endpointName="echo:EchoSoap11" serviceName="echo:EchoService" wsdlURL="echo.wsdl">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD" />
        </cxf:properties>
    </cxf:cxfEndpoint>

Every time I  tried to send a message to direct:test endpoint I got " No consumers available on endpoint" exception. 

When < jaxws:server xmlns:jaxws="http://cxf.apache.org/jaxws" .../> was bind to an direct endpoint there were no problems. Here is the definition of the endpoint 

    <jaxws:server id="echoService" address="camel://direct:test"
        endpointName="echo:EchoSoap11" serviceName="echo:EchoService" wsdlLocation="echo.wsdl"
        serviceClass="org.springframework.spring_ws.samples.echo.Echo">
    </jaxws:server>
   <camel:destination name="{http://www.springframework.org/spring-ws/samples/echo}EchoSoap11.camel-destination">
        <camel:camelContextRef>camel</camel:camelContextRef>
   </camel:destination>


It's rather interesting that we can change transport of <cxf:cxfEndpoint ...> endpoints that is not documented. For example, I was able to use activemq transport with the following configuration

    <cxf:cxfEndpoint id="echoService" address="camel://activemq:queue:EchoRequest?jmsMessageType=Bytes&amp;replyTo=EchoReply&amp;useMessageIDAsCorrelationID=true"
        endpointName="echo:EchoSoap11" serviceName="echo:EchoService" wsdlURL="echo.wsdl">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD" />
        </cxf:properties>
    </cxf:cxfEndpoint>

    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="file:c:/workspace/temp/cxf/req" />
            <inOut uri="cxf:bean:echoService"/>
            <to uri="log:org.test?level=INFO" />
            <to uri="file:c:/workspace/temp/cxf/resp"/>
        </route>
    </camelContext>

    <camel:conduit name="{http://www.springframework.org/spring-ws/samples/echo}EchoSoap11.camel-conduit">
        <camel:camelContextRef>camel</camel:camelContextRef>
    </camel:conduit>

    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="brokerURL" value="tcp://localhost:61616"/>
    </bean>




Best Regards,
Sergey Zhemzhitsky

-----Original Message-----
From: Christian Schneider [mailto:chris@die-schneider.net] 
Sent: Tuesday, April 26, 2011 11:22 AM
To: users@camel.apache.org
Subject: Re: Camel: SOAP over JMS

Hi Sergey,

I think you are mixing the camel transport for cxf and the camel cxf endpoint in your config. I have some experience how to use the camel transport for cxf which I think is the cleaner alternative anyway.

You already have configured the CamelTransporFactory. Next you should define an ordinary CXF Endpoint using regular CXF configs as if no camel was involved. The only thing you should do different is to set the address to address="camel:direct:yourendpointname". This makes the CXF endpoint available as a direct endpoint for camel. Next you can offer this on jms by:
<from uri="activemq:queue:EchoRequest"/>
<to uri="direct:yourendpointname"/>

This is the config you need on the server side.

On the client side you do a similar thing.

You can find a complete working example in the Talend Integration Factory examples. Talend Integration Factory is very similar to servicemix. It uses Karaf, Camel and CXF. So the example also applies to servicemix.
http://www.talend.com/download.php#IF

On the lower part of the website you can open Documentation and Examples. There you find the integration factory examples. The example you need is jaxws-jms.

While it is possible to run the code in servicemix I would advise to first try standalone as OSGi is an additional layer of complexity where stuff can go wrong. If you need any more help feel free to write to the list again.

Best regards

Christian


Am 26.04.2011 08:51, schrieb Zhemzhitsky Sergey:
> Hi there,
>
> I'm trying to configure SOAP over JMS by means of camel, cfx, activemq and servicemix (apache-servicemix-4.3.1-fuse-01-09).
>
> Here is documentation http://camel.apache.org/camel-transport-for-cxf.html I'm using.
>
> My configuration file looks like this
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>      xmlns:cxf="http://camel.apache.org/schema/cxf"
>      xmlns:jaxws="http://cxf.apache.org/jaxws"
>      xmlns:soap="http://cxf.apache.org/bindings/soap"
>      xmlns:echo="http://www.springframework.org/spring-ws/samples/echo"
>      xsi:schemaLocation="
>          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>          http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
>          http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
>      ">
>
>      <import resource="classpath:META-INF/cxf/cxf.xml" />
>      <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" 
> />
>
>      <bean class="org.apache.camel.component.cxf.transport.CamelTransportFactory">
>          <property name="bus" ref="cxf" />
>          <property name="camelContext" ref="camel" />
>          <property name="transportIds">
>              <list>
>                  <value>http://cxf.apache.org/transports/camel</value>
>              </list>
>          </property>
>      </bean>
>
>      <cxf:cxfEndpoint id="echoService" address="camel:activemq:queue:EchoRequest"
>          endpointName="echo:EchoSoap11" serviceName="echo:EchoService" wsdlURL="echo.wsdl">
>          <cxf:properties>
>              <entry key="dataFormat" value="PAYLOAD" />
>          </cxf:properties>
>      </cxf:cxfEndpoint>
>
>      <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>          <route>
>              <from uri="file:c:/workspace/temp/cxf/req" />
>              <inOut uri="activemq:queue:EchoRequest?jmsMessageType=Bytes&amp;replyTo=EchoReply&amp;useMessageIDAsCorrelationID=true"/>
>              <to uri="log:org.testapp?level=INFO" />
>              <to uri="file:c:/workspace/temp/cxf/resp"/>
>          </route>
>      </camelContext>
>
>      <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
>          <property name="brokerURL" value="tcp://localhost:61616"/>
>      </bean>
>
> </beans>
>
>  From the configuration - I'm trying to invoke CXF services when 
> sending messages to activemq. Messages are SOAP payloads and look like 
> this
>
> <echo:echoRequest 
> xmlns:echo="http://www.springframework.org/spring-ws/samples/echo">hel
> lo</echo:echoRequest>
>
> I'm expecting the payload to become a SOAP envelope
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:echo="http://www.springframework.org/spring-ws/samples/echo">
>     <soapenv:Header/>
>     <soapenv:Body>
>        <echo:echoRequest>hello</echo:echoRequest>
>     </soapenv:Body>
> </soapenv:Envelope>
>
> But it does not happen and there is only payload in the queue and it seems that CXF is not attached to the acvivemq endpoint.
>
> So the question is how to configure cxf+camel+activemq in the apache-servicemix-4.3.1-fuse-01-09 to create a fully functional SOAP envelope when sending only a payload into the queue?
>
>
> Best Regards,
> Sergey Zhemzhitsky
>
>
> _______________________________________________________
>
> The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia.
> If you need assistance please contact our Contact Center  (+7495) 258 
> 0500 or go to www.troika.ru/eng/Contacts/system.wbp
>
>

--
----
http://www.liquid-reality.de


_______________________________________________________

The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. 
If you need assistance please contact our Contact Center  (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp  



Re: Camel: SOAP over JMS

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Sergey,

I think you are mixing the camel transport for cxf and the camel cxf 
endpoint in your config. I have some experience how to use the camel 
transport for cxf which I think is the cleaner alternative anyway.

You already have configured the CamelTransporFactory. Next you should 
define an ordinary CXF Endpoint using regular CXF configs as if no camel 
was involved. The only thing you should do different is to set the 
address to
address="camel:direct:yourendpointname". This makes the CXF endpoint 
available as a direct endpoint for camel. Next you can offer this on jms by:
<from uri="activemq:queue:EchoRequest"/>
<to uri="direct:yourendpointname"/>

This is the config you need on the server side.

On the client side you do a similar thing.

You can find a complete working example in the Talend Integration 
Factory examples. Talend Integration Factory is very similar to 
servicemix. It uses Karaf, Camel and CXF. So the example also applies to 
servicemix.
http://www.talend.com/download.php#IF

On the lower part of the website you can open Documentation and 
Examples. There you find the integration factory examples. The example 
you need is jaxws-jms.

While it is possible to run the code in servicemix I would advise to 
first try standalone as OSGi is an additional layer of complexity where 
stuff can go wrong. If you need any more help feel free to write to the 
list again.

Best regards

Christian


Am 26.04.2011 08:51, schrieb Zhemzhitsky Sergey:
> Hi there,
>
> I'm trying to configure SOAP over JMS by means of camel, cfx, activemq and servicemix (apache-servicemix-4.3.1-fuse-01-09).
>
> Here is documentation http://camel.apache.org/camel-transport-for-cxf.html I'm using.
>
> My configuration file looks like this
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>      xmlns:cxf="http://camel.apache.org/schema/cxf"
>      xmlns:jaxws="http://cxf.apache.org/jaxws"
>      xmlns:soap="http://cxf.apache.org/bindings/soap"
>      xmlns:echo="http://www.springframework.org/spring-ws/samples/echo"
>      xsi:schemaLocation="
>          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>          http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
>          http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
>      ">
>
>      <import resource="classpath:META-INF/cxf/cxf.xml" />
>      <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>
>      <bean class="org.apache.camel.component.cxf.transport.CamelTransportFactory">
>          <property name="bus" ref="cxf" />
>          <property name="camelContext" ref="camel" />
>          <property name="transportIds">
>              <list>
>                  <value>http://cxf.apache.org/transports/camel</value>
>              </list>
>          </property>
>      </bean>
>
>      <cxf:cxfEndpoint id="echoService" address="camel:activemq:queue:EchoRequest"
>          endpointName="echo:EchoSoap11" serviceName="echo:EchoService" wsdlURL="echo.wsdl">
>          <cxf:properties>
>              <entry key="dataFormat" value="PAYLOAD" />
>          </cxf:properties>
>      </cxf:cxfEndpoint>
>
>      <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>          <route>
>              <from uri="file:c:/workspace/temp/cxf/req" />
>              <inOut uri="activemq:queue:EchoRequest?jmsMessageType=Bytes&amp;replyTo=EchoReply&amp;useMessageIDAsCorrelationID=true"/>
>              <to uri="log:org.testapp?level=INFO" />
>              <to uri="file:c:/workspace/temp/cxf/resp"/>
>          </route>
>      </camelContext>
>
>      <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
>          <property name="brokerURL" value="tcp://localhost:61616"/>
>      </bean>
>
> </beans>
>
>  From the configuration - I'm trying to invoke CXF services when sending messages to activemq. Messages are SOAP payloads and look like this
>
> <echo:echoRequest xmlns:echo="http://www.springframework.org/spring-ws/samples/echo">hello</echo:echoRequest>
>
> I'm expecting the payload to become a SOAP envelope
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:echo="http://www.springframework.org/spring-ws/samples/echo">
>     <soapenv:Header/>
>     <soapenv:Body>
>        <echo:echoRequest>hello</echo:echoRequest>
>     </soapenv:Body>
> </soapenv:Envelope>
>
> But it does not happen and there is only payload in the queue and it seems that CXF is not attached to the acvivemq endpoint.
>
> So the question is how to configure cxf+camel+activemq in the apache-servicemix-4.3.1-fuse-01-09 to create a fully functional SOAP envelope when sending only a payload into the queue?
>
>
> Best Regards,
> Sergey Zhemzhitsky
>
>
> _______________________________________________________
>
> The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia.
> If you need assistance please contact our Contact Center  (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp
>
>

-- 
----
http://www.liquid-reality.de


RE: Camel: SOAP over JMS

Posted by Zhemzhitsky Sergey <Se...@troika.ru>.
Hi Willem,

Thanks for help. I understood that I was incorrect and was using not an appropriate tool for soap over jms. I succeeded in configuring cxf to use jms transport using the following configuration

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:cxf="http://camel.apache.org/schema/cxf"
    xmlns:jaxws="http://cxf.apache.org/jaxws"
    xmlns:soap="http://cxf.apache.org/bindings/soap"
    xmlns:camel="http://cxf.apache.org/transports/camel"
    xmlns:echo="http://www.springframework.org/spring-ws/samples/echo"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
        http://cxf.apache.org/transports/camel http://cxf.apache.org/transports/camel.xsd
        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
    ">

    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-jms.xml" />

    <cxf:cxfEndpoint id="echoService" address="jms://"
        endpointName="echo:EchoSoap11" serviceName="echo:EchoService" wsdlURL="echo.wsdl">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD" />
        </cxf:properties>
        <cxf:features>
            <bean class="org.apache.cxf.transport.jms.JMSConfigFeature">
                <property name="jmsConfig" ref="jmsConfig"/>
            </bean>
        </cxf:features>
    </cxf:cxfEndpoint>

    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="file:c:/workspace/temp/cxf/req" />
            <inOut uri="cxf:bean:echoService"/>
            <to uri="log:ru.troika.cto?level=INFO" />
            <to uri="file:c:/workspace/temp/cxf/resp"/>
        </route>
    </camelContext>

     <bean id="jmsConfig" class="org.apache.cxf.transport.jms.JMSConfiguration">
        <property name="connectionFactory" ref="jmsConnectionFactory"/>
        <property name="useJms11" value="true"/>
        <property name="targetDestination" value="EchoRequest"/>
        <property name="replyDestination" value="EchoReply"/>
        <property name="messageType" value="byte"/>
     </bean>

     <bean id="jmsConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory">
        <property name="targetConnectionFactory">
            <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                <property name="brokerURL" value="tcp://localhost:61616" />
            </bean>
        </property>
    </bean>

</beans>

It's interesting that it's possible to use the following configuration too:

<cxf:cxfEndpoint id="echoService" address="camel://activemq:queue:EchoRequest?jmsMessageType=Bytes&amp;replyTo=EchoReply&amp;useMessageIDAsCorrelationID=true"
        endpointName="echo:EchoSoap11" serviceName="echo:EchoService" wsdlURL="echo.wsdl">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD" />
        </cxf:properties>
    </cxf:cxfEndpoint>

    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="file:c:/workspace/temp/cxf/req" />
            <inOut uri="cxf:bean:echoService"/>
            <to uri="log:org.test?level=INFO" />
            <to uri="file:c:/workspace/temp/cxf/resp"/>
        </route>
    </camelContext>

    <camel:conduit name="{http://www.springframework.org/spring-ws/samples/echo}EchoSoap11.camel-conduit">
        <camel:camelContextRef>camel</camel:camelContextRef>
    </camel:conduit>

    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="brokerURL" value="tcp://localhost:61616"/>
    </bean>


Best Regards,
Sergey Zhemzhitsky


-----Original Message-----
From: Willem Jiang [mailto:willem.jiang@gmail.com] 
Sent: Tuesday, April 26, 2011 3:28 PM
To: users@camel.apache.org
Subject: Re: Camel: SOAP over JMS

Hi,

If you want to use the SOAP over JMS, you don't need to use the camel transport for CXF.

Did you have a chance to try to create pure CXF with SOAP over JMS?

Willem

On 4/26/11 2:51 PM, Zhemzhitsky Sergey wrote:
> Hi there,
>
> I'm trying to configure SOAP over JMS by means of camel, cfx, activemq and servicemix (apache-servicemix-4.3.1-fuse-01-09).
>
> Here is documentation http://camel.apache.org/camel-transport-for-cxf.html I'm using.
>
> My configuration file looks like this
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>      xmlns:cxf="http://camel.apache.org/schema/cxf"
>      xmlns:jaxws="http://cxf.apache.org/jaxws"
>      xmlns:soap="http://cxf.apache.org/bindings/soap"
>      xmlns:echo="http://www.springframework.org/spring-ws/samples/echo"
>      xsi:schemaLocation="
>          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>          http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
>          http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
>      ">
>
>      <import resource="classpath:META-INF/cxf/cxf.xml" />
>      <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" 
> />
>
>      <bean class="org.apache.camel.component.cxf.transport.CamelTransportFactory">
>          <property name="bus" ref="cxf" />
>          <property name="camelContext" ref="camel" />
>          <property name="transportIds">
>              <list>
>                  <value>http://cxf.apache.org/transports/camel</value>
>              </list>
>          </property>
>      </bean>
>
>      <cxf:cxfEndpoint id="echoService" address="camel:activemq:queue:EchoRequest"
>          endpointName="echo:EchoSoap11" serviceName="echo:EchoService" wsdlURL="echo.wsdl">
>          <cxf:properties>
>              <entry key="dataFormat" value="PAYLOAD" />
>          </cxf:properties>
>      </cxf:cxfEndpoint>
>
>      <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>          <route>
>              <from uri="file:c:/workspace/temp/cxf/req" />
>              <inOut uri="activemq:queue:EchoRequest?jmsMessageType=Bytes&amp;replyTo=EchoReply&amp;useMessageIDAsCorrelationID=true"/>
>              <to uri="log:org.testapp?level=INFO" />
>              <to uri="file:c:/workspace/temp/cxf/resp"/>
>          </route>
>      </camelContext>
>
>      <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
>          <property name="brokerURL" value="tcp://localhost:61616"/>
>      </bean>
>
> </beans>
>
>  From the configuration - I'm trying to invoke CXF services when 
> sending messages to activemq. Messages are SOAP payloads and look like 
> this
>
> <echo:echoRequest 
> xmlns:echo="http://www.springframework.org/spring-ws/samples/echo">hel
> lo</echo:echoRequest>
>
> I'm expecting the payload to become a SOAP envelope
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:echo="http://www.springframework.org/spring-ws/samples/echo">
>     <soapenv:Header/>
>     <soapenv:Body>
>        <echo:echoRequest>hello</echo:echoRequest>
>     </soapenv:Body>
> </soapenv:Envelope>
>
> But it does not happen and there is only payload in the queue and it seems that CXF is not attached to the acvivemq endpoint.
>
> So the question is how to configure cxf+camel+activemq in the apache-servicemix-4.3.1-fuse-01-09 to create a fully functional SOAP envelope when sending only a payload into the queue?
>
>
> Best Regards,
> Sergey Zhemzhitsky
>
>
> _______________________________________________________
>
> The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia.
> If you need assistance please contact our Contact Center  (+7495) 258 
> 0500 or go to www.troika.ru/eng/Contacts/system.wbp
>
>


--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com

_______________________________________________________

The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. 
If you need assistance please contact our Contact Center  (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp  



Re: Camel: SOAP over JMS

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

If you want to use the SOAP over JMS, you don't need to use the camel 
transport for CXF.

Did you have a chance to try to create pure CXF with SOAP over JMS?

Willem

On 4/26/11 2:51 PM, Zhemzhitsky Sergey wrote:
> Hi there,
>
> I'm trying to configure SOAP over JMS by means of camel, cfx, activemq and servicemix (apache-servicemix-4.3.1-fuse-01-09).
>
> Here is documentation http://camel.apache.org/camel-transport-for-cxf.html I'm using.
>
> My configuration file looks like this
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>      xmlns:cxf="http://camel.apache.org/schema/cxf"
>      xmlns:jaxws="http://cxf.apache.org/jaxws"
>      xmlns:soap="http://cxf.apache.org/bindings/soap"
>      xmlns:echo="http://www.springframework.org/spring-ws/samples/echo"
>      xsi:schemaLocation="
>          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>          http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
>          http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
>      ">
>
>      <import resource="classpath:META-INF/cxf/cxf.xml" />
>      <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>
>      <bean class="org.apache.camel.component.cxf.transport.CamelTransportFactory">
>          <property name="bus" ref="cxf" />
>          <property name="camelContext" ref="camel" />
>          <property name="transportIds">
>              <list>
>                  <value>http://cxf.apache.org/transports/camel</value>
>              </list>
>          </property>
>      </bean>
>
>      <cxf:cxfEndpoint id="echoService" address="camel:activemq:queue:EchoRequest"
>          endpointName="echo:EchoSoap11" serviceName="echo:EchoService" wsdlURL="echo.wsdl">
>          <cxf:properties>
>              <entry key="dataFormat" value="PAYLOAD" />
>          </cxf:properties>
>      </cxf:cxfEndpoint>
>
>      <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>          <route>
>              <from uri="file:c:/workspace/temp/cxf/req" />
>              <inOut uri="activemq:queue:EchoRequest?jmsMessageType=Bytes&amp;replyTo=EchoReply&amp;useMessageIDAsCorrelationID=true"/>
>              <to uri="log:org.testapp?level=INFO" />
>              <to uri="file:c:/workspace/temp/cxf/resp"/>
>          </route>
>      </camelContext>
>
>      <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
>          <property name="brokerURL" value="tcp://localhost:61616"/>
>      </bean>
>
> </beans>
>
>  From the configuration - I'm trying to invoke CXF services when sending messages to activemq. Messages are SOAP payloads and look like this
>
> <echo:echoRequest xmlns:echo="http://www.springframework.org/spring-ws/samples/echo">hello</echo:echoRequest>
>
> I'm expecting the payload to become a SOAP envelope
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:echo="http://www.springframework.org/spring-ws/samples/echo">
>     <soapenv:Header/>
>     <soapenv:Body>
>        <echo:echoRequest>hello</echo:echoRequest>
>     </soapenv:Body>
> </soapenv:Envelope>
>
> But it does not happen and there is only payload in the queue and it seems that CXF is not attached to the acvivemq endpoint.
>
> So the question is how to configure cxf+camel+activemq in the apache-servicemix-4.3.1-fuse-01-09 to create a fully functional SOAP envelope when sending only a payload into the queue?
>
>
> Best Regards,
> Sergey Zhemzhitsky
>
>
> _______________________________________________________
>
> The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia.
> If you need assistance please contact our Contact Center  (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp
>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com