Saravanakumar Selvaraj created CAMEL-27392:
----------------------------------------------

             Summary: camel-spring-ws: three labels do not match the code, and 
the catalog lists type values that the endpoint URI does not take
                 Key: CAMEL-27392
                 URL: https://issues.apache.org/jira/browse/CAMEL-27392
             Project: Camel
          Issue Type: Bug
          Components: camel-spring-ws
    Affects Versions: 4.23.0
            Reporter: Saravanakumar Selvaraj


Found while reviewing the descriptions of camel-spring-ws for CAMEL-23832. The 
description of https://github.com/apache/camel/pull/29944 reported points 1 and 
4, and https://github.com/apache/camel/pull/30223 left point 1 unchanged. 
CAMEL-27034 fixed the same kind of label for outputAction and faultAction.

1. messageSender has the label producer, but the consumer uses it too. 
WSACamelEndpointMapping.getMessageSenders returns it for the endpoint of a 
consumer. Spring-WS sends a response with it when the response goes to the 
WS-Addressing ReplyTo or FaultTo address of the request. Because of the label:

- The Endpoint DSL offers messageSender only on the producer builder.
- The catalog validation in consumer-only mode reports messageSender as not 
applicable for a consumer URI that sets it.

2. sslContextParameters has the label security alone, but only the producer 
uses it. Its description says that the consumer does not use it. The Endpoint 
DSL offers it on the consumer builder too.

3. The header CamelSpringWebserviceSoapHeader has the label producer, but the 
consumer sets it too. SpringWebserviceConsumer sets it to the SOAP header of 
the request, as its description says. The catalog lists the header in the group 
producer.

4. The catalog lists the values of type as the names of the enum constants. 
They are ROOT_QNAME, ACTION, TO, SOAP_ACTION, XPATHRESULT, URI, URI_PATH and 
BEANNAME. The component finds the type by the prefix of the URI path and 
ignores its case (EndpointMappingType.getTypeFromUriPrefix). The prefixes are 
rootqname, action, to, soapaction, xpathresult, uri, uripath and beanname, each 
with a colon. So ROOT_QNAME, SOAP_ACTION and URI_PATH select no type. The 
catalog validation accepts these three and rejects rootqname, soapaction and 
uripath. For example, it reports type as an invalid enum value for this URI and 
suggests SOAP_ACTION:

spring-ws:soapaction:urn:GetFoo?endpointMapping=#endpointMapping

The validation reads a type only when it splits the path into three parts, as 
it does for this one. So it does not report the more common URIs, such as a 
rootqname with an http namespace.

Proposed change:

- messageSender: no label, as both sides use it.
- sslContextParameters: the labels producer and security.
- CamelSpringWebserviceSoapHeader: no label, as both sides use it.
- type: the eight values that the URI takes, in the enums attribute of its 
@UriPath annotation.

The second change removes sslContextParameters from the consumer builder of the 
Endpoint DSL, so the upgrade guide needs an entry.

Not part of this ticket: the validation also reports type for a producer URI 
whose address has a port. An example is spring-ws:http://localhost:8080/ws, 
where it takes http as the type. The split of the path causes that, not the 
enum values.

Checked on main at 43a888d8d6, which uses Spring-WS 5.1.0. The validation 
results come from a run of the catalog classes of that commit.

_Claude Code on behalf of saravanakumar1987_



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

Reply via email to