Hi,
Seems you are using soap over jms and in that spec how to specify 
username/password isn't mandated,  
From the spec
Credentials such as usernames and passwords might be required to access 
directories and to obtain JMS Connections from ConnectionFactories. This 
specification does not mandate how an implementation might obtain these 
credentials, although typically they can be available as API parameters, 
environment variables, or in thread context storage.


My other comment inline
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-8-28, at 下午4:36, Jan Bernhardt wrote:

> Hi Freeman,
> 
> thank you for your feedback. I was aware of the jmsConfig feature. But as far 
> as I understand this, if I use the jmsConfig feature CXF will completely 
> ignore all settings within the WSDL. Is this correct?
Yes
> 
> So if the destination would be changed in the WSDL, my service/client would 
> still connect to the "hard coded" JMS destination. This is not really 
> desirable IMHO.
> 
> Is there a way keep the destination dynamic?

In this case I think you can configure a jms destination for your endpoint, 
something like

<jms:destination 
name="{http://cxf.apache.org/jms_endpt}HelloWorldJMSPort.jms-destination";>
  <jms:address 
              ...
               connectionUserName="testUser"
               connectionPassword="testPassword">
…

This should work but I didn't test it yet.

Or you can use some code like

   JNDIConfiguration jndiConfig = destination.getJmsConfig().getJndiConfig();
   jndiConfig.setConnectionUserName("user");
   jndiConfig.setConnectionPassword("password");

to specify it on your jms destination
> 
> IMHO it would be best, if CXF supports some jaxws:properties to set username 
> and password and using all other settings from the WSDL.
I'm OK with it and feel free to create a jira ticket, and patch is welcomed, as 
always
> 
> WDYT?
> 
> Best regards.
> Jan
> 
>> -----Original Message-----
>> From: Freeman Fang [mailto:[email protected]]
>> Sent: Mittwoch, 28. August 2013 10:06
>> To: [email protected]
>> Subject: Re: Authentication with JMS Transport
>> 
>> Hi,
>> 
>> For your endpoint you can configure
>> org.apache.activemq.ActiveMQConnectionFactory yourself, where you can
>> specify
>> 
>>        <property name="userName" value="..." />
>>        <property name="password" value="..." />
>> 
>> The whole configuration would be like
>> 
>> <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" />
>>                        <property name="userName" value="..." />
>>                      <property name="password" value="..." />
>> 
>>              </bean>
>>      </property>
>> </bean>
>> 
>> <bean id="jmsConfig"
>> class="org.apache.cxf.transport.jms.JMSConfiguration"
>>      p:connectionFactory-ref="jmsConnectionFactory"
>>      p:targetDestination="test.queue"
>> />
>> 
>>      <!-- JMS Endpoint -->
>>      <jaxws:endpoint
>> xmlns:customer="http://customerservice.example.com/";
>>              id="CustomerServiceHTTP" address="jms://"
>> 
>>      implementor="com.example.customerservice.server.CustomerServi
>> ceImpl">
>>              <jaxws:features>
>>                      <bean
>> class="org.apache.cxf.feature.LoggingFeature" />
>>                      <bean
>> class="org.apache.cxf.transport.jms.JMSConfigFeature" p:jmsConfig-
>> ref="jmsConfig" />
>>              </jaxws:features>
>>      </jaxws:endpoint>
>> 
>> Take a look at jms_spring_config example shipped with kit to get more
>> details.
>> 
>> -------------
>> Freeman(Yue) Fang
>> 
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Web: http://fusesource.com | http://www.redhat.com/
>> Twitter: freemanfang
>> Blog: http://freemanfang.blogspot.com
>> http://blog.sina.com.cn/u/1473905042
>> weibo: @Freeman小屋
>> 
>> 
>> 
>> On 2013-8-28, at 下午3:36, Jan Bernhardt wrote:
>> 
>>> I'm sorry, I hit the wrong key combination (Ctrl+Enter) an my message
>>> was sent before I was done writing it.
>>> 
>>> I'm currently testing JMS transport for my webservice communication in
>>> a WSDL first approache.
>>> 
>>> <soap:binding style="document"
>>> transport="http://schemas.xmlsoap.org/soap/http"/>
>>> 
>> <soapjms:jndiConnectionFactoryName>ConnectionFactory</soapjms:jndiCo
>> nn
>>> ection
>>> FactoryName>
>>> <soapjms:jndiInitialContextFactory>org.apache.activemq.jndi.ActiveMQIn
>>> itialC ontextFactory</soapjms:jndiInitialContextFactory>
>>> <soapjms:jndiURL>tcp://0.0.0.0:61616</soapjms:jndiURL>
>>> 
>>> It is working fine without any additional configuration within my
>>> jaxws:endpoint.
>>> 
>>> <!-- JMS Queue Endpoint -->
>>> <jaxws:endpoint id="CRMServiceJMSQueue"
>>>       xmlns:serviceNamespace="http://services.talend.org/CRMService";
>>>       serviceName="serviceNamespace:CRMServiceProvider"
>>> endpointName="serviceNamespace:CRMServiceJMSQueuePort"
>>>       implementor="#CRMServiceBean"
>>> wsdlLocation="WEB-INF/wsdl/CRMService.wsdl">
>>> </jaxws:endpoint>
>>> 
>>> But now, I would like to enable authentication at my ActiveMQ JMS
>>> broker, but I do not now, who to configure the the jaxws:endpoint to
>>> provide unsername and password for this.
>>> Are there any jaxws:properties to be set to accomplish this?
>>> 
>>> I'm running my demo in a karaf OSGi Container and I do not complete
>>> understand the magic of where the JMS Conenction Factory comes from,
>>> because I do not provide any settings for it at any place. I guess the
>>> connection factory would be the right place to set username and
>>> password, but I do not know how to configure the connection factory
>> within my OSGi environment.
>>> 
>>> Can someone help me here?
>>> 
>>> Best regards.
>>> Jan
>>> 
>>>> -----Original Message-----
>>>> From: Jan Bernhardt
>>>> Sent: Mittwoch, 28. August 2013 09:28
>>>> To: '[email protected]'
>>>> Subject: Authentication with JMS Transport
>>>> 
>>>> Hi CXF users,
>>>> 
>>>> I'm currently testing JMS transport for my webservice communication
>>>> in a WSDL first approache.
>>>> 
>>>> 
>>>> Viele Grüße
>>>> Jan
>>> 
> 

Reply via email to