Hi,

I prefer to use the JaxWsServerFactoryBean in a combination with the 
JmsConfiguration-feature.
Then you do not need the WSDL at all, just the annotated interface and 
service-impl object.

It goes like this:
        JaxWsServerFactoryBean jaxWsServerFactoryBean = new 
JaxWsServerFactoryBean();
        // set serviceClass and implementing bean
        jaxWsServerFactoryBean.setServiceClass(serviceInterfaceClass);
        jaxWsServerFactoryBean.setAddress("jms://");
        jaxWsServerFactoryBean.setServiceBean(serviceImplementingBean); 


        JMSConfiguration configuration = new JMSConfiguration();
        configuration.setTargetDestination("topicName");
        configuration.setPubSubDomain(true); // pubSub = topic
        
         JMSConfigFeature configFeature = new JMSConfigFeature();
       configFeature.setJmsConfig(configuration);
       jaxWsServerFactoryBean.setFeatures(Arrays.asList((AbstractFeature) 
configFeature));

       jaxWsServerFactoryBean.create();

/Hartmut


-----Original Message-----
From: Daniel Kulp [mailto:[email protected]] 
Sent: Freitag, 3. Februar 2012 20:32
To: [email protected]
Cc: anhtuannd
Subject: Re: How to change JMS topic name programmatically in CXF generated 
client?


I think if you do the same basic thing you do for updating HTTP settings, you 
can change the JMS settings:


JMSConduit c = (JMSConduit)ClientProxy.getClient(port).getConduit()
c.getJmsConfig().setXYZ(....);

Dan


On Wednesday, February 01, 2012 4:26:55 AM anhtuannd wrote:
> I have WSDL file which contains:
> 
>               <wsdl:port name="NotificationConsumerSoapJms"
>                       
binding="tns_NotificationConsumer:NotificationConsumerSoapJmsBinding">
>                       <jms:address destinationStyle="topic"
>                               jndiConnectionFactoryName="ConnectionFactory"
>                               
> jndiDestinationName="dynamicTopics/test.DefaultTopic">
> 
>                               <jms:JMSNamingProperty 
> name="java.naming.factory.initial"
>                                       
value="org.apache.activemq.jndi.ActiveMQInitialContextFactory" />
>                               <jms:JMSNamingProperty 
> name="java.naming.provider.url"
>                                       value="tcp://localhost:61616" />
>                       </jms:address>
>               </wsdl:port>
> 
> And here is JMS client which was generated by CXF:
> 
>         URL wsdlURL = EfaNbiWebService.WSDL_LOCATION;
>         if (args.length > 0 && args[0] != null && !"".equals(args[0])) {
>             File wsdlFile = new File(args[0]);
>             try {
>                 if (wsdlFile.exists()) {           JMSConfiguration 
> configuration = new JMSConfiguration();
            configuration.setConnectionFactory(cf);
            configuration.setTargetDestination(usedTargetDestination);
            configuration.setConcurrentConsumers(concurrentConsumers);
            configuration.setPubSubDomain(pubSubDomain);           
JMSConfiguration configuration = new JMSConfiguration();
            configuration.setConnectionFactory(cf);
            configuration.setTargetDestination(usedTargetDestination);
            configuration.setConcurrentConsumers(concurrentConsumers);
            configuration.setPubSubDomain(pubSubDomain);
>                     wsdlURL = wsdlFile.toURI().toURL();
>                 } else {
>                     wsdlURL = new URL(args[0]);
>                 }
>             } catch (MalformedURLException e) {
>                 e.printStackTrace();
>             }
>         }
> 
>         EfaNbiWebService ss = new EfaNbiWebService(wsdlURL, SERVICE_NAME);
>         NotificationConsumer port = ss.getNotificationConsumerSoapJms();
> 
> 
>         {
>         System.out.println("Invoking notify...");
>         org.tmforum.mtop.fmw.xsd.hdr.v1.Header _notify_mtopHeader = null;
>         org.tmforum.mtop.fmw.xsd.notmsg.v1.Notify _notify_mtopBody = null;
>         port.notify(_notify_mtopHeader, _notify_mtopBody);
> 
> 
>         }
> 
> As you see, the topic name is store in WSDL file. So how to change topic
> name programmatically?
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/How-to-change-JMS-topic-name-programmatical
> ly-in-CXF-generated-client-tp5447330p5447330.html Sent from the cxf-user
> mailing list archive at Nabble.com.
-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to