Saravanakumar Selvaraj created CAMEL-27393:
----------------------------------------------

             Summary: camel-catalog: the validation rejects a spring-ws 
producer URI whose address has a port
                 Key: CAMEL-27393
                 URL: https://issues.apache.org/jira/browse/CAMEL-27393
             Project: Camel
          Issue Type: Bug
          Components: camel-catalog, camel-spring-ws
    Affects Versions: 4.23.0
            Reporter: Saravanakumar Selvaraj


Found while checking CAMEL-27392. The catalog reads the path of a spring-ws URI 
by the syntax spring-ws:type:lookupKey:webServiceEndpointUri. A real URI has 
either type and lookupKey, for a consumer, or webServiceEndpointUri, for a 
producer. So the catalog gives the parts of the path to the wrong options.

1. The validation rejects a producer URI whose address has a port. For this 
URI, validateEndpointProperties reports type as an invalid enum value:

spring-ws:http://localhost:8080/ws

endpointProperties returns type=http, lookupKey=localhost and 
webServiceEndpointUri=8080/ws for it. The validate goal of 
camel-report-maven-plugin calls validateEndpointProperties for each endpoint 
URI of the routes.

2. When the catalog splits a path into two parts, endpointProperties returns 
only the first part, as webServiceEndpointUri:

- spring-ws:http://localhost/ws gives webServiceEndpointUri=http.
- spring-ws:beanname:myDispatcher gives webServiceEndpointUri=beanname.

asEndpointUri builds spring-ws:http and spring-ws:beanname from these options.

3. For a consumer URI, the catalog returns a type only when it splits the path 
into three parts. The other two options are then wrong. For 
spring-ws:soapaction:urn:GetFoo it returns lookupKey=urn and 
webServiceEndpointUri=GetFoo.

The component splits the path in another way 
(SpringWebserviceComponent.createEndpoint). A path that starts with a type 
prefix, such as rootqname: or soapaction:, gives the type and the lookupKey. 
Any other path is the address for the producer.

Proposed change: the catalog splits the path of a spring-ws URI as the 
component does. AbstractCamelCatalog.findTokens already has a special case for 
activemq and jms.

This change needs the values of type that CAMEL-27392 proposes. Without them, 
the validation would reject rootqname, soapaction and uripath in every consumer 
URI.

Checked on main at 43a888d8d6 and on the tag camel-4.23.0, with a run of the 
catalog classes of each.

_Claude Code on behalf of saravanakumar1987_



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

Reply via email to