Hi
On 09/01/12 23:05, Henri Tremblay wrote:
Hi,

I'm having a CXF client. This client is configured with failover. It is
also configured with http authentication. I'll show you the setup below.

My problem is that both are working separately but not together. The
authentication doesn't work on the alternate addresses. I think it's
because it's not the same conduit.

Can someone help me to setup it?

The failover configuration:

       <jaxws:client id=*"stuff"* serviceClass=*"com.acme.MyService"* address
=*"${main_url}"*>

             <jaxws:features>

                   <clustering:failover>

                         <clustering:strategy>

                              <bean class=*
"org.apache.cxf.clustering.SequentialStrategy"*>

                                    <property name=*"alternateAddresses"*>

                                          <util:list>

                                                <value>${backup_url}</value>

                                          </util:list>

                                    </property>

                              </bean>

                         </clustering:strategy>

                   </clustering:failover>

             </jaxws:features>
       </jaxws:client>

And the code for the authentification:

       @PostConstruct

       *private* *void* makeDigestHttpAuth() {

             *final* Client proxy = ClientProxy.*getClient*(clientProxy);

             *final* HTTPConduit conduit = (HTTPConduit) proxy.getConduit();

             *final* AuthorizationPolicy authorizationPolicy =
*new*AuthorizationPolicy();

             authorizationPolicy.setUserName(userName);

             authorizationPolicy.setPassword(password);

             conduit.setAuthorization(authorizationPolicy);

             conduit.setAuthSupplier(*new* DigestAuthSupplier());
       }

Thanks for your help

I suspect you may need to manage it outside of the PostConstruct handler, perhaps in the Spring config or at the level of the custom CXF outbound interceptor

Cheers, Sergey

-
Henri



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to