Hi Juanjo,

you can have a dummy wsdl with one-way operation sending messaage to the
queue which your service is accessing. Also, make sure you use conduit
configuration for configuring client. destination configuration is used
for the service.

your configuration should look like following snippet taken from CXF jms
test config :

<beans
    xmlns="http://www.springframework.org/schema/beans";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xmlns:ct="http://cxf.apache.org/configuration/types";
    xmlns:jms="http://cxf.apache.org/transports/jms";
    xsi:schemaLocation="
http://cxf.apache.org/transports/jms
http://cxf.apache.org/schemas/configuration/jms.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd";>
   
    <jms:conduit
name="{http://cxf.apache.org/jms_conf_test}HelloWorldQueueBinMsgPort.jms-conduit";>
      <jms:clientConfig clientReceiveTimeout="500" messageTimeToLive="500"/>
      <jms:runtimePolicy messageType="binary"/>
      <jms:sessionPool lowWaterMark="10" highWaterMark="5000"/>
      <jms:address
          destinationStyle="queue"
          jndiConnectionFactoryName="MockConnectionFactory"
          jndiDestinationName="myOwnDestination"
          jndiReplyDestinationName="myOwnReplyDestination"
          connectionUserName="testUser"
          connectionPassword="testPassword">
          <jms:JMSNamingProperty name="java.naming.factory.initial"
value="org.apache.cxf.transport.jms.MockInitialContextFactory"/>
          <jms:JMSNamingProperty name="java.naming.provider.url"
value="tcp://localhost:61616"/>
      </jms:address>
    </jms:conduit>
</beans>

Regards,

Ulhas Bhole





Juan José Vázquez Delgado wrote:
> Thank you guys, it looks that this configuration works:
>
> <?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:jaxws="http://cxf.apache.org/jaxws";
>    xmlns:jms="http://cxf.apache.org/transports/jms";
>    xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>                           http://cxf.apache.org/jaxws
> http://cxf.apache.org/schemas/jaxws.xsd
>                           http://cxf.apache.org/transports/jms
> http://cxf.apache.org/schemas/configuration/jms.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"/>
>
>    <jms:destination name="{
> http://services.com/}DummyJMSServiceImplPort.jms-destination";>
>        <jms:address destinationStyle="queue"
>                     jndiConnectionFactoryName="ConnectionFactory"
>                     jndiDestinationName="foo.bar">
>
>        <jms:JMSNamingProperty name="java.naming.factory.initial"
>                               value="
> org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
>        <jms:JMSNamingProperty name="java.naming.provider.url"
>                               value="tcp://localhost:2212"/>
>
>        </jms:address>
>    </jms:destination>
>
> </beans>
>
> Although i´m very confused about how can i make a client to this
> Service JMS
> Endpoint. I have been looking the sample "jms_queue" in the cxf
> 2.0distribution but it´s not clear for me doing it with the Spring
> configuration.
>
> A few questions:
>
> 1. Should I have an implementor class, i mean, an DummyJMSServiceImpl
> class?
>
> 2. Should I have a DummyJMSService interface for the server and client?
>
> 2. Should I have a wsdl file?
>
> I´d like having similar to an HTTP client like this:
>
> <?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:jaxws="http://cxf.apache.org/jaxws";
>    xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>                           http://cxf.apache.org/jaxws
> http://cxf.apache.org/schemas/jaxws.xsd";>
>
>    <bean id="penelope.wsclient.dummyServiceClient" class="
> es.cm.penelope.services.DummyService"
>              factory-bean="penelope.wsclient.dummyServiceClientFactory"
> factory-method="create"/>
>
>    <bean id="penelope.wsclient.dummyServiceClientFactory"
>          class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
>          <property name="serviceClass" value="
> es.cm.penelope.services.DummyService" />
>          <property name="address" value="
> http://toshiba001:8080/penelope-wsprovider/DummyService"; />
>    </bean>
> </beans>
>
>
> Is this possible?.
>
> Do you have a JMS sample with Spring configuration?.
>
> (I only want to send a message to a queue, snif)
>
> Thanks a lot!.
>
> On 7/24/07, Willem Jiang <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>>
>> You can use CXF over JMS, we support JMS transport in CXF.
>>
>> There are some JMS spring configuration updates in CXF 2.0, you need to
>> change
>> <jms:destination id="{
>> http://services.com/}DummyJMSServiceImplPort.jms-destination";>
>>
>> to
>>
>> <jms:destination name="{
>> http://services.com/}DummyJMSServiceImplPort.jms-destination";> .
>>
>> It just need to change the 'id' to 'name'. I will update the wiki for
>> it.
>>
>> BTW,  if you just do not want to use servlet transport , you could
>> remove
>> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />  from the
>> spring configuration file.
>>
>>
>> Cheers,
>>
>> Willem.
>>
>> Juan José Vázquez Delgado wrote:
>> > Hi guys,
>> >
>> > I´m trying configure an endpoint to use JMS queues with CXF. The use
>> > case is
>> > a client that sends a message to an activemq queue. I have a few
>> > questions
>> > about this:
>> >
>> > 1. Should I using CXF over JMS?
>> >
>> > I´m not sure if i should using CXF over HTTP, and for example Camel
>> for
>> > routing the message towards the queue, instead.
>> >
>> > 2. Spring configuration
>> >
>> > I have tried to configure an endpoint over JMS with Spring but it
>> doesn´t
>> > work. I used this documentation:
>> >
>> > http://cwiki.apache.org/CXF20DOC/jms-transport.html
>> >
>> > First of all, if I only use the configuration namespace xmlns:jms="
>> > http://cxf.apache.org/transports/jms"; like this:
>> >
>> > <?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:jaxws="http://cxf.apache.org/jaxws";
>> >    xmlns:jms="http://cxf.apache.org/transports/jms";
>> >    xsi:schemaLocation="http://www.springframework.org/schema/beans
>> > http://www.springframework.org/schema/beans/spring-beans-2.0.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-servlet.xml" />
>> >    <import resource="classpath:META-INF/cxf/cxf-extension-jms.xml"/>
>> >
>> >
>> >    <jms:destination id="{
>> > http://services.com/}DummyJMSServiceImplPort.jms-destination";>
>> >        <jms:address destinationStyle="queue"
>> >                     jndiConnectionFactoryName="ConnectionFactory"
>> >                     jndiDestinationName="foo.bar">
>> >
>> >        <jms:JMSNamingProperty name="java.naming.factory.initial"
>> >                               value="
>> > org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
>> >        <jms:JMSNamingProperty name="java.naming.provider.url"
>> >                               value="tcp://localhost:2212"/>
>> >
>> >        </jms:address>
>> >    </jms:destination>
>> >
>> > </beans>
>> >
>> >
>> > i get this error:
>> >
>> > The matching wildcard is strict, but no declaration can be found for
>> > element
>> > 'jms:destination'.
>> >
>> > Then i tried to add the schemaLocation like this:
>> >
>> > <beans xmlns="http://www.springframework.org/schema/beans";
>> >    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> >    xmlns:jaxws="http://cxf.apache.org/jaxws";
>> >    xmlns:jms="http://cxf.apache.org/transports/jms";
>> >    xsi:schemaLocation="http://www.springframework.org/schema/beans
>> > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>> >                           http://cxf.apache.org/jaxws
>> > http://cxf.apache.org/schemas/jaxws.xsd
>> >                           http://cxf.apache.org/transports/jms
>> > http://cxf.apache.org/schemas/configuration/jms.xsd";>
>> >
>> > but then i get this error:
>> >
>> > org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '{
>> > http://services.com/}DummyJMSServiceImplPort.jms-destination' is not a
>> > valid
>> > value for 'NCName'.
>> >    at
>> >
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
>>
>> >
>> > (ErrorHandlerWrapper.java:236)...
>> >
>> > Please, i need help to continue, any ideas?.
>> >
>> > Thanks.
>> >
>> > Juanjo
>> >
>>
>

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to