davsclaus commented on issue #144:
URL:
https://github.com/apache/camel-jbang-examples/issues/144#issuecomment-7140727402
An update: the SOAP Kamelets for 4.24 are finished, and the "Later" items
above are done. This makes the examples simpler.
**What changed since this issue was written**
- **JSON bodies** (`bodyFormat: json`, apache/camel-kamelets#3357,
CAMEL-27375): the route works with JSON typed by the XML schema of the WSDL,
such as `{"orderId": "7"}`. Numbers and booleans get their JSON type, and an
element that can repeat is always an array. There is also
`ignoreUnknownFields`, and `requestElement` on `soap-action`.
- **WS-Security UsernameToken** (`wsSecurityUsername`, `wsSecurityPassword`
and `wsSecurityPasswordType`, apache/camel-kamelets#3356, CAMEL-27373). Camel
JBang downloads `cxf-rt-ws-security` by itself, and `camel export` adds it to
the project, so no `--dep` is needed (#3359, CAMEL-27395). A wrong password
gives a fault with the code `SecurityError`.
- **Where the service is served** (#3359, CAMEL-27389): `soap-source` serves
at `path` on the HTTP server of the integration, under `/services`, such as
`http://localhost:8080/services/orders`, with the WSDL at `?wsdl`. Port and TLS
are the `camel.server.*` settings.
- **Faults** (#3356, CAMEL-27372): besides the `SoapFault` and
`SoapFaultCode` headers, the route can reply with a `<soap:Fault>` as XML text.
- **`soap-action`:** `address` is optional (the address in the WSDL is
used), and `username` and `password` give HTTP basic auth.
**Changes to the proposal**
1. **The facade** can use `bodyFormat: json` on `soap-source`, so the route
passes JSON to the REST service and back with no XML mapping. That is the
strongest point of the example: a SOAP front for a JSON backend in a few lines
of YAML.
2. **The client example** can use `bodyFormat: json` on `soap-action`
instead of `xj-identity-action`. Keep `faultAsBody: true` to show how a fault
is passed on.
3. **"Try changing" items:** WS-Security on both sides (the facade requires
a UsernameToken and the client sends it, then try a wrong password), and SOAP
1.2.
4. **README, "Good to know":** replace "`soap-source` has no login" with
"there is no login unless `wsSecurityUsername` and `wsSecurityPassword` are
set; protect the URL with your network too". The rest still holds: requests
with a DOCTYPE are refused, schema validation is on by default, a failing route
gives `Exchange processing failed`, and catching `SoapFault` by class needs
`camel:cxf-soap`.
The examples CI runs the released Camel, so the PR waits for Camel 4.24.0
and camel-kamelets 4.24.0. The Citrus tests in camel-kamelets under
`tests/camel-kamelets-itest/src/test/resources/soap/` cover all of this and can
be the starting point.
_Claude Code on behalf of Claus Ibsen_
--
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]