Hi ,

I think you need to import the jms module in your spring configuration file
<import resource="classpath:META-INF/cxf/cxf-extension-jms.xml" />

and set the endpoint transportId attribute with
"http://cxf.apache.org/transports/jms";

But I just found current <jaxws:endpoint> doesn't support to set the
transportId, so you need to use <jaxws:server> to walk around this issue.

<jaxws:server
         xmlns:customer="http://customerservice.example.com/";
         id="CustomerService"
         address="jms://"
         serviceName="customer:CustomerServiceService"
         endpointName="customer:CustomerServiceEndpoint"

 serviceClass="com.example.customerservice.impl.CustomerServiceImpl">
         <jaxws:features>
             <bean
                 class="org.apache.cxf.transport.jms.JMSConfigFeature"
                 p:jmsConfig-ref="jmsConfig" />
         </jaxws:features>
</jaxws:server>

Willem

jp4 wrote:
> Christian,
> 
> This is exactly what I have been attempting to do, and based on examples and
> the documentation it was unclear to me whether or not this should work.  I
> already have service interfaces that have been generated by wsdl2java as
> well as Impl classes.  The Impl classes are already configured as spring
> beans so I'd prefer to use the existing beans for both jms and http
> processing if possible.  I uploaded my latest configuration to this thread
> earlier, but I still haven't been able to get it to work.  I believe the
> crux of the problem is that the destination that is being passed to the
> JMSConfig is an instance of ServletDestination rather than an actual JMS
> Destination.  I'm hoping it's a simple config issue.  Any suggestions would
> be greatly appreciated.
> 
> Thanks,
> 
> John
> 
> Christian Schneider wrote:
>> Hi John and Dan,
>>
>> it is possible to publish a jms endpoint with a wsdl that does not 
>> contain jms information.
>> You can use the wsdl with http information to generate the  java code 
>> and then setup the jms endpoint with a spring config. It is even 
>> possible to work without a wsdl by using
>> the jaxws annotations.
>>
>> Basically you simply need a jaxws:endpoint:
>>
>>     <jaxws:endpoint
>>         xmlns:customer="http://customerservice.example.com/";
>>         id="CustomerService"
>>         address="jms://"
>>         serviceName="customer:CustomerServiceService"
>>         endpointName="customer:CustomerServiceEndpoint"
>>        
>> implementor="com.example.customerservice.impl.CustomerServiceImpl">
>>         <jaxws:features>
>>             <bean
>>                 class="org.apache.cxf.transport.jms.JMSConfigFeature"
>>                 p:jmsConfig-ref="jmsConfig" />
>>         </jaxws:features>
>>     </jaxws:endpoint>
>>
>> serviceName and endpointName can be set to any values. The whole jms 
>> config is done in the jmsConfig bean.
>>
>>     <bean
>>         id="jmsConfig"
>>         class="org.apache.cxf.transport.jms.JMSConfiguration"
>>         p:useJms11="true"
>>         p:connectionFactory-ref="jmsConnectionFactory"
>>         p:targetDestination="test.cxf.jmstransport.queue" />
>>
>>     <bean
>>         id="jmsConnectionFactory"
>>         class="org.apache.activemq.ActiveMQConnectionFactory">
>>         <property
>>             name="brokerURL"
>>             value="tcp://localhost:61616" />
>>     </bean>
>>
>> I hope this helps .. greetings
>>
>> Christian
>>
>> Daniel Kulp schrieb:
>>> Not sure it's currently possible without a modified wsdl.    I think the 
>>> transport factory is chosen from the extensor in the service/port and the 
>>> "soap" extensor maps to the soap transport which I think would just know
>>> about 
>>> http as it would look at the transport id on the soap:binding thing in
>>> the 
>>> binding.  (would need to double check that)
>>>
>>> You could TRY setting a unique (fake) serviceName/endpointName  (probably
>>> just 
>>> the endpointName) and seeing if the runtime would create a new one for
>>> it.   
>>> I'm not sure if that would work though.
>>>
>>> The best option would probably be to create a small wsdl that just
>>> imports the 
>>> other wsdl and adds a jms service/port.   (basically, a really small
>>> wsdl)   
>>>
>>> Dan
>>>
>>>
>>> On Fri May 29 2009 1:31:49 pm jp4 wrote:
>>>   
>>>> This updated configuration gives the same error.  It's almost identical
>>>> to
>>>> my HTTP endpoint except for the address and jmsConfig feature... 
>>>> Namespaces, wsdl, servicename, and endpoint all match the WSDL but I get
>>>> the same error (Caused by:
>>>> org.apache.cxf.configuration.ConfigurationException: You can only use
>>>> JMSConfigFeature with the jms transport).  Any help would be greatly
>>>> appreciated as I'm under some tight deadlines to get this stuff working.
>>>>
>>>> Thanks,
>>>>
>>>> John
>>>>
>>>>    <jaxws:endpoint  id="JMSSingleSignOnServicesImpl_1_0_0"
>>>>                             wsdlLocation="SingleSignOn_1_0_0.wsdl"
>>>>                             serviceName="as:SingleSignOnServicePorts"
>>>>                             endpointName="as:SingleSignOnService"
>>>>
>>>> xmlns:as="http://www.foo.com/enterpriseservices/accountservices/singlesigno
>>>> n_1_0_0" address="jms://"
>>>>                                     
>>>> implementor="#singleSignOnServicesImpl_1_0_0">
>>>>            <jaxws:features>
>>>>                    <bean 
>>>> class="org.apache.cxf.transport.jms.JMSConfigFeature"
>>>> p:jmsConfig-ref="jmsConfig" />
>>>>            </jaxws:features>
>>>>    </jaxws:endpoint>
>>>>
>>>> <bean id="wrappedConnectionFactory"
>>>> 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>
>>>>
>>>> <bean id="jndiDestinationResolver"
>>>> class="org.springframework.jms.support.destination.JndiDestinationResolver"
>>>>     
>>>>> <property name="jndiTemplate" ref="jndiTemplate"/>
>>>>>       
>>>> </bean>
>>>>
>>>> <bean id="jmsConfig"
>>>> class="org.apache.cxf.transport.jms.JMSConfiguration"
>>>>    p:connectionFactory-ref="wrappedConnectionFactory"
>>>>    p:destinationResolver-ref="jndiDestinationResolver"
>>>>    p:targetDestination="accountServicesRequestQueue"
>>>>    p:replyDestination="accountServicesResponseQueue">
>>>> </bean>
>>>>
>>>>   <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
>>>>     <property name="environment">
>>>>       <props>
>>>>         <prop
>>>> key="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialC
>>>> ontextFactory</prop> <prop
>>>> key="java.naming.provider.url">tcp://localhost:61616</prop> <!-- lets
>>>> register some destinations -->
>>>>         <prop
>>>> key="queue.accountServicesRequestQueue">accountServicesRequestQueue</prop>
>>>>         <prop
>>>> key="queue.accountServicesResponseQueue">accountServicesResponseQueue</prop
>>>>     
>>>>> </props>
>>>>>       
>>>>     </property>
>>>>   </bean>
>>>>
>>>> jp4 wrote:
>>>>     
>>>>> I am currently using cxf 2.2.  I have several http endpoints (which are
>>>>> generated from wsdl).  These endpoints work great since dumping the
>>>>> jboss
>>>>> native stack!
>>>>>
>>>>> Now I'd like one of my endpoints to support both http as well as jms.
>>>>> I've read the cxf docs, but it's unclear whether or not I can do this
>>>>> without modifying the WSDL.  Ideally, I'd just like to configure
>>>>> another
>>>>> endpoint which listens on a request queue (and delegates to the
>>>>> endpoint
>>>>> that I have already configured in spring).
>>>>>
>>>>> I have the following configuration which throws the following exception
>>>>> on startup... I have configured the address="jms://".   Can anyone
>>>>> point
>>>>> me in the right direction?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> John
>>>>>
>>>>> Caused by: org.apache.cxf.configuration.ConfigurationException: You can
>>>>> only use JMSConfigFeature with the jms transport
>>>>>     at
>>>>> org.apache.cxf.transport.jms.JMSConfigFeature.initialize(JMSConfigFeature
>>>>> .java:61)
>>>>>
>>>>>
>>>>>   <bean id="wsCtx"
>>>>> class="org.apache.cxf.jaxws.context.WebServiceContextImpl"/>
>>>>>
>>>>>   <jaxws:endpoint  id="JMSSingleSignOnServicesImpl_1_0_0"
>>>>>                                    address="jms://"
>>>>>                                    
>>>>> implementor="#singleSignOnServicesImpl_1_0_0">
>>>>>           <jaxws:features>
>>>>>                   <bean 
>>>>> class="org.apache.cxf.transport.jms.JMSConfigFeature"
>>>>> p:jmsConfig-ref="jmsConfig" />
>>>>>           </jaxws:features>
>>>>>   </jaxws:endpoint>
>>>>>
>>>>> <bean id="jndiConfig"
>>>>> class="org.apache.cxf.transport.jms.JNDIConfiguration">
>>>>>     <property name="environment">
>>>>>       <props>
>>>>>         <prop
>>>>> key="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitia
>>>>> lContextFactory</prop> <prop
>>>>> key="java.naming.provider.url">tcp://localhost:61616</prop> </props>
>>>>>     </property>
>>>>> </bean>
>>>>>
>>>>> <bean id="wrappedConnectionFactory"
>>>>> 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>
>>>>>
>>>>> <bean id="jmsConfig"
>>>>> class="org.apache.cxf.transport.jms.JMSConfiguration"
>>>>> p:jndiConfig-ref="jndiConfig"
>>>>>   p:connectionFactory-ref="wrappedConnectionFactory"
>>>>>   p:jndiTemplate-ref="jndiTemplate"
>>>>>   p:targetDestination="accountServicesRequestQueue"
>>>>>   p:replyDestination="accountServicesResponseQueue">
>>>>> </bean>
>>>>>       
>>>   
>>
>> -- 
>>
>> Christian Schneider
>> ---
>> http://www.liquid-reality.de
>>
>>
>>
> 

Reply via email to