You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -342,6 +342,28 @@ public class Example {
342
342
}
343
343
```
344
344
345
+
### SOAP
346
+
[SOAP](./soap) includes an encoder and decoder you can use with an XML API.
347
+
348
+
349
+
This module adds support for encoding and decoding SOAP Body objects via JAXB and SOAPMessage. It also provides SOAPFault decoding capabilities by wrapping them into the original `javax.xml.ws.soap.SOAPFaultException`, so that you'll only need to catch `SOAPFaultException` in order to handle SOAPFault.
350
+
351
+
Add `SOAPEncoder` and/or `SOAPDecoder` to your `Feign.Builder` like so:
352
+
353
+
```java
354
+
publicclassExample {
355
+
publicstaticvoidmain(String[] args) {
356
+
Api api =Feign.builder()
357
+
.encoder(newSOAPEncoder(jaxbFactory))
358
+
.decoder(newSOAPDecoder(jaxbFactory))
359
+
.errorDecoder(newSOAPErrorDecoder())
360
+
.target(MyApi.class, "http://api");
361
+
}
362
+
}
363
+
```
364
+
365
+
NB: you may also need to add `SOAPErrorDecoder` if SOAP Faults are returned in response with error http codes (4xx, 5xx, ...)
366
+
345
367
### SLF4J
346
368
[SLF4JModule](./slf4j) allows directing Feign's logging to [SLF4J](http://www.slf4j.org/), allowing you to easily use a logging backend of your choice (Logback, Log4J, etc.)
This module adds support for encoding and decoding SOAP Body objects via JAXB and SOAPMessage. It also provides SOAPFault decoding capabilities by wrapping them into the original `javax.xml.ws.soap.SOAPFaultException`, so that you'll only need to catch `SOAPFaultException` in order to handle SOAPFault.
5
+
6
+
Add `SOAPEncoder` and/or `SOAPDecoder` to your `Feign.Builder` like so:
Because a SOAP Fault can be returned as well with a 200 http code than a 4xx or 5xx HTTP error code (depending on the used API), you may also use `SOAPErrorDecoder` in your API configuration, in order to be able to catch `SOAPFaultException` in case of SOAP Fault. Add it, like below:
0 commit comments