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
-
Henri

Reply via email to