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

   # Description
   
   Fixes [CAMEL-27034](https://issues.apache.org/jira/browse/CAMEL-27034), the 
follow-up that both reviews of apache/camel#29944 named.
   
   ## What was wrong
   
   `SpringWebserviceConfiguration` gave the options `outputAction` and 
`faultAction` the label `producer`, but only the consumer uses them. 
`WSACamelEndpointMapping` reads them in `getResponseAction` and 
`getFaultAction`, from the endpoint of a `SpringWebserviceConsumer`, for the 
WS-Addressing Action header of the response and of a SOAP fault that the 
consumer returns. `SpringWebserviceProducer` does not read them. So:
   
   - The component JSON listed both options in the group `producer`, and so did 
the option tables of the doc page, which are built from it.
   - The Endpoint DSL had their methods only in 
`SpringWebserviceEndpointProducerBuilder`, so a consumer route could not chain 
them: `from(springWs(...).outputAction(...))` did not compile, and after a 
consumer option such as `endpointMapping(...)` the builder did not offer them.
   - In consumer-only mode, the endpoint validation of the catalog reported 
both options on a consumer URI with "Option not applicable in consumer only 
mode", as `AbstractCamelCatalog.validateProperties` reports there each option 
whose label contains `producer`. So tooling that validates in that mode 
reported them on a consumer endpoint, the only place where they work.
   
   ## The change
   
   - `outputAction` and `faultAction` have the label `consumer`. The last 
sentence of both descriptions, "The producer does not use it.", is removed: the 
label now says it, and no other consumer option of the component has such a 
sentence. Nothing else in the texts changes. In the class, the two fields move 
from the part under `/* Producer configuration */` to the part under `/* 
Consumer configuration */`.
   - The component JSON and its catalog copy list both options in the group 
`consumer`.
   - In the Endpoint DSL, the four methods `outputAction(java.net.URI)`, 
`outputAction(String)`, `faultAction(java.net.URI)` and `faultAction(String)` 
moved from `SpringWebserviceEndpointProducerBuilder` to 
`SpringWebserviceEndpointConsumerBuilder`, and return the consumer builder. A 
call of one of them on the producer builder no longer compiles, and neither 
does `to(springWs(...).outputAction(...))`. Code compiled against an earlier 
version that calls one of them must be recompiled. Nothing in the repository 
calls them.
   - The upgrade guide of 4.24 has a section on it.
   
   The endpoint configurer and the URI factory of the module do not change, so 
the behavior of the component at runtime does not change.
   
   ## Tests
   
   The new `CamelCatalogTest#testValidateEndpointSpringWsConsumerOptions` 
follows `testValidateEndpointConsumerOnly` and 
`testValidateEndpointProducerOnly`, in their style, with JUnit assertions:
   
   - A consumer URI with `endpointMapping`, `outputAction` and `faultAction` 
validates with success in consumer-only mode.
   - A producer URI with `outputAction` and `faultAction` reports both as not 
applicable in producer-only mode.
   
   There is no new test in the module: the change is metadata only. 
`ConsumerWSAEndpointMappingRouteTest`, which the build runs, uses both options 
in the `from` URIs of its Spring XML context. Two more Spring XML contexts of 
the WS-Addressing tests use them, but only test classes whose names end with 
`Tests` load them, and the build runs only `*Test` classes.
   
   ## How it was verified
   
   - With the new test and without the change, the test failed in its first 
assertion: in consumer-only mode, the catalog reported `outputAction` and 
`faultAction` with "Option not applicable in consumer only mode".
   - With the change, `mvn install -nsu` in the module ran 111 tests, 17 of 
them skipped, with no failure, error or rerun, and changed only the component 
JSON among the generated files.
   - With the change, `mvn install -DskipTests -nsu` in `catalog/camel-catalog` 
and in `dsl/camel-endpointdsl` regenerated the catalog copy of the component 
JSON and `SpringWebserviceEndpointBuilderFactory`.
   - With the change and the regenerated files, the new test passes.
   - Small routes were compiled with `javac` against the Endpoint DSL before 
and after the change. `from(springWs(...).outputAction(...))` did not compile 
before, and compiles after. `to(springWs(...).outputAction(...))` compiled 
before, and does not compile after, as `outputAction` now returns the consumer 
builder. `to(springWs(...).soapAction(...).faultAction(...))` compiled before, 
and does not compile after, as the producer builder no longer has `faultAction`.
   - A class compiled against the Endpoint DSL before the change, which calls 
`springWs(...).outputAction(...)`, failed with a `NoSuchMethodError` when it 
ran with the regenerated one. Compiled again, it ran.
   
   ## Not changed
   
   - `messageSender` keeps the label `producer`, although the consumer can use 
it too. The producer sends its requests with it: for a producer endpoint, 
`SpringWebserviceComponent` sets it on the `WebServiceTemplate`. With a 
`WSACamelEndpointMapping`, Spring-WS also sends the response of the consumer 
with it when the response goes to the WS-Addressing ReplyTo or FaultTo address 
of the request, as its description says. 
`WSACamelEndpointMapping.getMessageSenders` returns it for the endpoint of the 
consumer, and the `AddressingEndpointInterceptor` of Spring-WS sends such a 
response with these senders. So in consumer-only mode, the catalog still 
reports `messageSender` on a consumer URI, and the Endpoint DSL offers it only 
on the producer builder. Its label does not change here, because the ticket is 
about the two options that only the consumer uses.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [x] I have run `mvn clean install -Dquickly -DskipTests` from the root 
folder on upstream `main` (27efa340d2df, the parent of this commit), and then, 
with the change, `mvn install -nsu` in 
`components/camel-spring-parent/camel-spring-ws`, which also runs its code 
generators, the formatter and the import sorter, and `mvn install -DskipTests 
-nsu` in `catalog/camel-catalog` and in `dsl/camel-endpointdsl`. I have 
committed all auto-generated changes: the component JSON, its catalog copy and 
`SpringWebserviceEndpointBuilderFactory`.
   
   The commands that were run:
   
   ```
   # in catalog/camel-catalog, with the new test and without the change
   mvn -o -B test 
-Dtest=CamelCatalogTest#testValidateEndpointSpringWsConsumerOptions 
-Dsurefire.failIfNoSpecifiedTests=false -Dsurefire.rerunFailingTestsCount=0
   # with the change, in components/camel-spring-parent/camel-spring-ws
   mvn install -nsu
   # then in catalog/camel-catalog and in dsl/camel-endpointdsl
   mvn install -DskipTests -nsu
   # then again in catalog/camel-catalog
   mvn -o -B test 
-Dtest=CamelCatalogTest#testValidateEndpointSpringWsConsumerOptions 
-Dsurefire.failIfNoSpecifiedTests=false -Dsurefire.rerunFailingTestsCount=0
   ```
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
   
   The change, the test and this text were drafted with Claude Code 
(Anthropic), from the ticket, the code of camel-spring-ws, camel-catalog and 
the Endpoint DSL, and the bytecode of `spring-ws-core` 5.0.3. The tests were 
run as described above. The change and the claims of this text were checked by 
an independent AI review.
   
   _Claude Code on behalf of saravanakumar1987_
   
   🤖 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