davsclaus opened a new pull request, #30586:
URL: https://github.com/apache/camel/pull/30586

   ## What was wrong
   
   [CAMEL-27374](https://issues.apache.org/jira/browse/CAMEL-27374): a `cxf:` 
producer given only `wsdlURL`, `serviceName` and `portName` 
(`cxf://?wsdlURL=...`) failed with `MalformedURLException: URI with undefined 
scheme` instead of calling the `soap:address` that the WSDL gives for the port.
   
   The endpoint address is the remaining part of the URI, which is an empty 
string for `cxf://?...`. `CxfEndpoint.setupClientFactoryBean` passed it to the 
CXF `ClientFactoryBean`, and CXF only falls back to the address of the WSDL 
port when the address is `null`: a non-null address, even an empty one, 
replaces it. A `CxfEndpoint` bean without an address (address `null`) already 
used the WSDL address.
   
   ## The fix
   
   `setupClientFactoryBean` passes an empty address as `null`, so CXF uses the 
address of the port in the WSDL. An explicit address and the 
`CamelDestinationOverrideUrl` header still win.
   
   The consumer side (`setupServerFactoryBean`) is unchanged on purpose: an 
empty or relative address is meaningful there (for example with the servlet 
transport).
   
   Docs:
   - the description of the `address` path option says what a producer with no 
address does (regenerated `cxf.json`, catalog `cxf.json`, endpoint DSL)
   - `cxf-component.adoc` ("URI format") has a short paragraph and example; the 
catalog copy is updated
   
   No upgrade guide entry: a producer with an empty address could not send 
anything before.
   
   ## Tests
   
   New `CxfProducerWsdlAddressTest` (camel-cxf-soap): a `cxf:` consumer serves 
`person.wsdl`, and a producer 
`cxf://?wsdlURL=RAW(<service>?wsdl)&serviceName=...&portName=...&dataFormat=PAYLOAD`
 loads the WSDL the service serves (whose `soap:address` is the service address 
on the free test port) and calls it. Without the fix it fails with `URI with 
undefined scheme` (same as the prototype from the kamelets session); with the 
fix it passes.
   
   - `mvn test` in `components/camel-cxf/camel-cxf-soap`: 212 tests, 0 
failures, 0 errors, 4 skipped
   - `mvn test` in `components/camel-cxf/camel-cxf-spring-soap` (against this 
change of camel-cxf-soap): 161 tests, 0 failures, 0 errors, 3 skipped
   
   Note: when the WSDL has more than one service or port, `serviceName` and 
`portName` are still needed (CXF's own check: "Port/endpoint name must be 
specified").
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to