Claus Ibsen created CAMEL-27395:
-----------------------------------

             Summary: camel-jbang - download cxf-rt-ws-security when a cxf 
endpoint uses the wsSecurity options
                 Key: CAMEL-27395
                 URL: https://issues.apache.org/jira/browse/CAMEL-27395
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Claus Ibsen
             Fix For: 4.24.0


A cxf endpoint with {{wsSecurityUsername}} and {{wsSecurityPassword}} (a 
WS-Security UsernameToken, on a consumer or a producer) needs 
{{org.apache.cxf:cxf-rt-ws-security}}, which camel-cxf-soap does not bring. 
With {{camel run}}, the user has to add it by hand, of the CXF version Camel 
uses:

{noformat}
camel run --dep=mvn:org.apache.cxf:cxf-rt-ws-security:4.2.4 orders.camel.yaml
{noformat}

Without it, the route fails at startup (with a clear message). The version must 
match the CXF of the Camel release, which the user rarely knows.

The auto-configure script of camel-cxf-soap 
({{dsl/camel-kamelet-main/src/main/resources/auto-configure/camel-cxf-soap.java}})
 already adds CXF jars for the CLI. It could download {{cxf-rt-ws-security}} of 
{{$\{cxf-version\}}} as well, when an endpoint sets one of the {{wsSecurity*}} 
options, and only then, since the jar brings WSS4J and more that most SOAP 
routes do not need. {{camel export}} should add the dependency in the same case.

The {{soap-source}} and {{soap-action}} Kamelets (camel-kamelets) now tell 
users to add the {{--dep}}; with this they no longer need to.

Also in the camel-cxf docs: a consumer that refuses the UsernameToken (a wrong 
password, or a password type other than {{wsSecurityPasswordType}}) answers 
with a SOAP fault whose code is {{SecurityError}}. The docs only describe 
{{Client}} and {{Server}} style fault codes; the {{wsSecurity*}} options could 
say which code a refused token gives.

Found while adding the soap-source and soap-action Kamelets to the Kamelet 
catalog (apache/camel-kamelets, 2026-11-22).



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to