Advanced SOAP client topics

client-endpoint-url defaults

If you omit the client-endpoint-url property in, the CXF Quarkus extension will assume that the service is published at http://localhost:8080/{service-path}, where {service-path} is derived from

  • Configuration property quarkus.cxf.path (if specified); and the

  • SEI’s class name in lower case

Given quarkus.cxf.path = /ws, the default effective client-endpoint-url of the CalculatorService would be http://localhost:8080/ws/org.jboss.eap.quickstarts.wscalculator.calculator.calculatorservice.

If quarkus.cxf.path is not specified, the client-endpoint-url would be just http://localhost:8080/org.jboss.eap.quickstarts.wscalculator.calculator.calculatorservice.

Configure multiple clients

In the example above, we configured just a single client called myCalculator. Of course, you can configure multiple clients pointing at different URLs and/or implementing different SEIs using multiple identifiers: = http://localhost:8082
quarkus.cxf.client.myCalculator.wsdl = ${}/calculator-ws/CalculatorService?wsdl
quarkus.cxf.client.myCalculator.client-endpoint-url = ${}/calculator-ws/CalculatorService
quarkus.cxf.client.myCalculator.service-interface = org.jboss.eap.quickstarts.wscalculator.calculator.CalculatorService

# another client
quarkus.cxf.client.anotherCalculator.wsdl =
quarkus.cxf.client.anotherCalculator.client-endpoint-url =
quarkus.cxf.client.anotherCalculator.service-interface = org.jboss.eap.quickstarts.wscalculator.calculator.CalculatorService

Basic Authentication

Basic authentication for clients is supported by default. Just add the following properties to your

quarkus.cxf.client.myCalculator.username = user
quarkus.cxf.client.myCalculator.password = password


See the description of quarkus.cxf.client.myClient.proxy-* properties.

Advanced Client Configurations

To globally configure all clients in your application, you can use the example snippet below to configure the HttpConduit. This allows you to set the HTTPClientPolicy, AuthorizationPolicy, ProxyAuthorizationPolicy or even TLSClientParameters for your clients.

void onStart(@Observes StartupEvent ev) {

     HTTPConduitConfigurer httpConduitConfigurer = new HTTPConduitConfigurer() {
         public void configure(String name, String address, HTTPConduit c) {
             AsyncHTTPConduit conduit = (AsyncHTTPConduit)c;
             // use setter to configure client
             conduit.getHttpAsyncClient().getCredentialsProvider().setCredentials( AuthScope.ANY,
              new NTCredentials( USER,PWD, "", DOM ) );
             conduit.getClient().setAllowChunking( false );
             conduit.getClient().setAutoRedirect( true );

     final Bus bus = BusFactory.getThreadDefaultBus();
     bus.setExtension(httpConduitConfigurer, HTTPConduitConfigurer.class);

To configure the HttpConduit for a single client in your application, use the example snippet below:

    SomePortType portType;

    void configurePortType() throws NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException {
        final var httpConduit = (HTTPConduit) ClientProxy.getClient(portType).getConduit();
        final var tlsClientParameters = Optional.ofNullable(httpConduit.getTlsClientParameters()).orElseGet(TLSClientParameters::new);

Pure client applications

Quarkus batch (e.g. periodically scheduled), or command line applications, may do without an HTTP server. Use the property below to prevent launching the HTTP server at startup: = false

Prevent resource leaks

CXF client proxies implement Therefore, it is important to call ((Closeable) proxy).close() once the client is not needed anymore to free all associated system resources, such as threads.

CXF Extensions for Quarkus takes care for closing the clients injected via @io.quarkiverse.cxf.annotation.CXFClient automatically as soon as they are disposed by the CDI container.

For client proxies created manually, it is up to you to call ((Closeable) proxy).close():

import javax.xml.namespace.QName;

final URL serviceUrl = new URL("http://localhost/myService?wsdl");
final QName qName = new QName("", "MyService");
final Service service =, qName);
final MyService proxy = service.getPort(MyService.class);

try {
} finally {
    ((Closeable) proxy).close();