From 0d6b78d6b264e940dad50a685b9488a8d0b81a3e Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Sun, 19 Jan 2020 14:41:52 -0500 Subject: [PATCH] Update SOAP Encoder Documentation for useFirstChild (#1161) Adds additional informatiom into the Soap README that includes details on how to instruct the SOAP Decoder to use `getFirstChild` instead of `extractContentAsDocument` in situations where JAXB is unable to read any xml declarations on the SOAP Envelope. --- soap/README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/soap/README.md b/soap/README.md index c6e804b9..6bcb5ce2 100644 --- a/soap/README.md +++ b/soap/README.md @@ -47,4 +47,11 @@ api = Feign.builder() .decoder(new SOAPDecoder(jaxbFactory)) .errorDecoder(new SOAPErrorDecoder()) .target(MyApi.class, "http://api"); -``` \ No newline at end of file +``` + +In certain situations the declarations on the SOAP envelope are not inherited by JAXB when reading the documents. This is particularly +troublesome when it is not possible to correct the XML at the source. + +To account for this situation, use the `useFirstChild` option on the `SOAPDecoder` builder. This will instruct JAX be to use `SOAPBody#getFirstChild()` +instead of `SOAPBody#extractContentAsDocument()`. This will allow users to supply a `package-info.java` to manage the element namespaces +explicitly and define what should occur if the namespace declarations are missing. \ No newline at end of file