Riptide: SOAP adds SOAP support to Riptide.
http.post()
.body(new PlaceOrderRequest(order))
.call(soap(PlaceOrderResponse.class, this::onSuccess));
- adds the ability to send/receive SOAP requests/responses
- JAXB
- Riptide Core
Add the following dependency to your project:
<dependency>
<groupId>org.zalando</groupId>
<artifactId>riptide-soap</artifactId>
<version>${riptide.version}</version>
</dependency>
Http.builder()
.baseUrl("https://example.org/ws/echoService")
.converter(new SOAPHttpMessageConverter())
.converter(new SOAPFaultHttpMessageConverter())
.build();
http.post()
.body(new PlaceOrderRequest(order))
.call(soap(PlaceOrderResponse.class, this::onSuccess));
Please note that you can just use Http#post()
without specifying any request URI or path since
the base URL itself is already enough to make a SOAP request.
The soap
route is just a small helper covering the default scenario for SOAP responses:
200 OK
with a SOAP body500 Internal Server Error
with a SOAP fault (thrown as aSOAPFaultException
)
It's equivalent to:
http.post()
.body(new PlaceOrderRequest(order))
.dispatch(status(),
on(OK).call(PlaceOrderResponse,class, this::onSuccess),
on(INTERNAL_SERVER_ERROR).call(SOAPFault.class, fault -> {
throw new SOAPFaultException(fault);
}))
In case the response is not interesting it can be discarded:
http.post()
.body(new PlaceOrderRequest(order))
.call(soap(pass()));
If you have questions, concerns, bug reports, etc., please file an issue in this repository's Issue Tracker.
To contribute, simply open a pull request and add a brief description (1-2 sentences) of your addition or change. For more details, check the contribution guidelines.