Repository navigation
Adds opt-in Content-Type propagation to SOAPDecoder - #3698
Open
RahimovShaxriyor wants to merge 1 commit into
Open
RahimovShaxriyor wants to merge 1 commit into
RahimovShaxriyor wants to merge 1 commit into
Conversation
`SOAPDecoder` created the `SOAPMessage` without MIME headers, so SAAJ always assumed a plain SOAP envelope. Responses such as MTOM/XOP (`multipart/related`) failed with "Unable to create envelope", and `DYNAMIC_SOAP_PROTOCOL` could not be used at all. `SOAPDecoder.Builder#propagateContentType()` passes the response's `Content-Type` header to the `MessageFactory`. It is disabled by default to keep the current behavior, as suggested in the issue. Applied to both `feign-soap` and `feign-soap-jakarta`. Fixes OpenFeign#1732 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
SOAPDecoder.Builder#propagateContentType(), which passes the response'sContent-Typeheader to SAAJ'sMessageFactory. Disabled by default, as suggested by @kdavisk6 in #1732. Applied to bothfeign-soapandfeign-soap-jakarta, with a README note.Root Cause
SOAPDecodercallsMessageFactory.createMessage(null, body). Without MIME headers SAAJ assumes a plain envelope, so an MTOM/XOP (multipart/related) response fails withUnable to create envelope from given source, andDYNAMIC_SOAP_PROTOCOLfails with an NPE.Tests
New tests in
SOAPCodecTest(both modules):DYNAMIC_SOAP_PROTOCOLandapplication/soap+xml;Content-Typeheader still decodes.The first and third fail without the change.
mvn -Pdev -pl soap,soap-jakarta -am clean installpasses locally.Out of scope: resolving
xop:Includebinary parts (anAttachmentUnmarshaller, mentioned in the issue comments).Closes #1732
🤖 Generated with Claude Code