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

   _Claude Code on behalf of davsclaus_
   
   JIRA: https://issues.apache.org/jira/browse/CAMEL-27393
   
   ## What was wrong
   
   The catalog split the path of a spring-ws URI by the syntax 
`spring-ws:type:lookupKey:webServiceEndpointUri`. A real URI has either a type 
and a lookupKey (consumer) or a webServiceEndpointUri (producer), and both the 
lookupKey and the address may contain colons, so `endpointProperties` gave the 
parts to the wrong options:
   
   - `spring-ws:http://localhost:8080/ws` gave type=http, lookupKey=localhost, 
webServiceEndpointUri=8080/ws, and `validateEndpointProperties` reported `http` 
as an invalid enum value for type. The validate goal of 
camel-report-maven-plugin calls this for every endpoint URI in the routes.
   - `spring-ws:http://localhost/ws` gave webServiceEndpointUri=http, and 
`spring-ws:beanname:myDispatcher` gave webServiceEndpointUri=beanname. 
`asEndpointUri` then built `spring-ws:http` and `spring-ws:beanname`.
   - `spring-ws:soapaction:urn:GetFoo` gave lookupKey=urn and 
webServiceEndpointUri=GetFoo.
   
   ## What changed
   
   `AbstractCamelCatalog.findTokens` has a special case for spring-ws, next to 
the existing one for activemq and jms. It splits the path as 
`SpringWebserviceComponent` does (`EndpointMappingType.getTypeFromUriPrefix`): 
a path that starts with one of the type prefixes (`rootqname:`, `action:`, 
`to:`, `soapaction:`, `xpathresult:`, `uri:`, `uripath:`, `beanname:`, 
case-insensitive) is the type and the lookupKey (the rest of the path, colons 
and `{...}` included), and any other path is the webServiceEndpointUri. The 
type keeps the case it is written in; the enum check is already 
case-insensitive. The type enum values are the lowercase prefixes since 
CAMEL-27392.
   
   `asEndpointUri` needed no change: it builds the path from the options that 
are set, so with the right options from `endpointProperties` a round trip gives 
back the URI.
   
   The lookupKey is returned as written. The component also strips a leading 
`//` and turns `(...)` into `{...}` in it; the catalog does not, so a round 
trip keeps the URI as it was written.
   
   ## How tested
   
   New tests in `CamelCatalogTest` (4 test methods): endpointProperties for 
consumer URIs (rootqname with `{http://example.com/}GetFoo`, soapaction, 
beanname, action, xpathresult, a mixed-case type, an `{{env:...}}` placeholder) 
and producer URIs (with and without a port, https with a query, an 
`{{env:...}}` placeholder), validateEndpointProperties for consumer and 
producer URIs with a port, and the round trip through asEndpointUri for 8 URIs. 
All 4 failed on main before the fix. The whole camel-catalog module passes: 
1161 tests, 0 failures. A comment in `CamelCatalogEdgeCasesTest` that used a 
spring-ws URI as an example of the generic split is updated.
   
   No upgrade guide entry: this is a bug fix in the catalog's validation and 
parsing, with no changed option or default.
   
   🤖 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