Allow authentication per URL for the same outbound SOAP service in CXF

Solution Verified - Updated -

Issue

  • We have an application that uses one outbound SOAP port (WSDL) but can have several endpoints for the SOAP port. Each of these endpoints will have its own authentication parameters (username/password). The application needs to be configured in XML as much as possible.

  • We found this link and the conduit element allows us to set authorization on endpoints. However, we can only have one conduit with the SOAP port as name. A second conduit with the same name will overwrite the settings for the first one, effectively setting the same settings (authorization) for all endpoints. That means that we cannot use this type of name for the conduit.

  • We have already tried using the URLs as names, and that works. However, we cannot hard-code the URLs inside the configuration. Using the properties as names for the conduits does not work though.

  • In short:

    • Using the SOAP port as name (name="{urn:com.redhat:soap:orders}SomePort.http-conduit") does not work, as only one of the actual settings will be used, the others will be discarded.
    • Using a hard-coded address as name (name="http://localhost/cxf/someURI/orders") works, but we cannot hard-code the address.
    • Using the URL property as name (name="${url_property}") does not work; the conduit is not used for the outbound connections.
  • Is there a way to have one conduit per endpoint address without having to hard-code the address ?

  • That link as above also describes how to create the endpoint from code. It is currently created in XML, and we cannot change this. How could we set a HTTPConduit in code to an endpoint created in XML ? Or is this not possible?

Environment

  • Red Hat JBoss Fuse
    • 6.x
  • Apache CXF

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content