Custom SOAPFault detail unmarshaling #188
Merged
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.
#180
Background
This PR fixes the described discrepancy between SOAP 1.1 spec and gowsdl implementation of fault detail.
Overview of changes
Add a new function
which allows to inject a custom fault detail type, similar to request and response.
Previously existing
Call
function remain backwards compatible and passes innil
for the fault, which is correctly handled (ignores detail information).A slight awkwardness with this approach is: you cannot simply rely on Body.Fault == nil as a condition indicating there is no fault, since Fault is initialized with the custom detail type. Instead, there's a boolean
faultOccurred
, which is filled out during Body unmarshalling.SOAPFault has to still be a pointer, since it has to be nil to pass a check in
TestClient_MTOM
, since it enforces that there are not multiple elements inside SOAP body.