Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-6084

SOAP over JMS does not work with camel-cxf endpoint

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.10.0
    • 2.9.6, 2.10.4, 2.11.0
    • camel-cxf
    • None
    • Unknown

    Description

      If we would like to use SOAP over JMS using CXF & Camel (2.10),that fails.

      The CXF endpoint receives well the incoming request from the JMS queue

      [aultMessageListenerContainer-1] HelloWorldServicePortType INFO  Inbound Message
      ----------------------------
      ID: 1
      Content-Type: text/xml
      Headers: {JMSMessageType=[text]}
      Payload: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://helloworld.mycompany.redhat.com">
         <soapenv:Header/>
         <soapenv:Body>
            <hel:sayHello>
               <hel:name>fred</hel:name>
            </hel:sayHello>
         </soapenv:Body>
      </soapenv:Envelope>
      
      --------------------------------------
      [aultMessageListenerContainer-1] route1 INFO  SOAP Request received message
      [aultMessageListenerContainer-1] route1 INFO  Mock service replied
      
      

      but the response is not returned by CXF neither published in a (reply) queue.

      Here is the Camel Route
      
          @Override
          public void configure() throws Exception {
      
      from("cxf:bean:endpoint.service.worklist?dataFormat=MESSAGE")
                      .convertBodyTo(String.class)
                      .log("SOAP Request received message")
      .setHeader("JMSReplyTo").constant("supervisorworklist.response")
                      .transform().constant(response) // RESPONSE = SOAP MESSAGE
                      .log("Mock service replied");
      
          }
      
      

      & Config

      <?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:camel="http://camel.apache.org/schema/spring"
             xmlns:osgi="http://www.springframework.org/schema/osgi"
             xmlns:cxf="http://camel.apache.org/schema/cxf"
             xmlns:jms="http://cxf.apache.org/transports/jms"
             xsi:schemaLocation="
             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
             http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
             http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
             http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf-2.10.0-spring.xsd
             http://cxf.apache.org/transports/jms http://cxf.apache.org/schemas/configuration/jms.xsd">
      
      
          <bean id="jms.connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
             <!-- <property name="brokerURL" value="vm://myEmbeddedBroker?broker.persistent=false" />-->
              <property name="brokerURL" value="tcp://localhost:61616"/>
          </bean>
      
          <bean id="jms.config.service" class="org.apache.cxf.transport.jms.JMSConfiguration">
              <property name="connectionFactory" ref="jms.connectionFactory" />
              <property name="targetDestination" value="supervisorworklist" />
              <property name="replyDestination" value="supervisorworklist.response"/>
          </bean>
      
          <bean id="logginOutInterceptor" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
          <bean id="logginInInterceptor" class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
      
          <!--  Producer Endpoint -->
          <cxf:cxfEndpoint id="endpoint.service.worklist"
                           address="jms://"
      serviceClass="com.redhat.mycompany.helloworld.HelloWorldService"
                           serviceName="s:HelloWorldService"
                           endpointName="s:HelloWorldOverJms"
                           xmlns:s="http://helloworld.atos.redhat.com">
      
              <cxf:features>
                  <bean xmlns="http://www.springframework.org/schema/beans"
      class="org.apache.cxf.transport.jms.JMSConfigFeature">
                      <property name="jmsConfig" ref="jms.config.service" />
                  </bean>
              </cxf:features>
      
               <cxf:inInterceptors>
                   <ref bean="logginInInterceptor"/>
               </cxf:inInterceptors>
      
               <cxf:outInterceptors>
                   <ref bean="logginOutInterceptor"/>
               </cxf:outInterceptors>
          </cxf:cxfEndpoint>
      
      
          <camelContext xmlns="http://camel.apache.org/schema/spring">
              <package>com.redhat.mycompany.cxf</package>
          </camelContext>
      
      </beans>
      

      Attachments

        Activity

          People

            njiang Willem Jiang
            cmoulliard Moulliard Charles
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: