Skip to content

SOAP 1.2 support - #35

Merged
rubyjedi merged 1 commit into
masterfrom
feature/soap-1.2-support
Jul 16, 2026
Merged

SOAP 1.2 support#35
rubyjedi merged 1 commit into
masterfrom
feature/soap-1.2-support

Conversation

@rubyjedi

Copy link
Copy Markdown
Owner

Summary

  • Adds SOAP 1.2 support: envelope namespace, header role/relay attributes (replacing 1.1's actor/mustUnderstand-only model), the 1.2 fault model (Code/Reason/Node/Role/Detail instead of faultcode/faultstring/faultactor/detail), and correct HTTP transport (application/soap+xml content type with the SOAPAction folded into the action parameter, per spec, instead of the 1.1 SOAPAction header).
  • Extends WSDL binding support to recognize the SOAP 1.2 binding namespace alongside 1.1.
  • Fixes SOAP-with-Attachments (MIME multipart) to honor soap_version for the parts' media type instead of hardcoding text/xml, with a pragmatic fallback: multipart requests still send the legacy SOAPAction header even under 1.2, since action-placement for multipart+1.2 combined isn't settled by any spec and real-world use of that combination is rare.
  • New SOAP::SOAPVersion (SOAPVersion1_1/SOAPVersion1_2) bundles the per-version envelope namespace, attribute names, media type, and content-type builder used throughout.

Test plan

…sport, WSDL binding

Adds SOAP::SOAPVersion, a small bundle class for the constants that
differ between SOAP 1.1 and 1.2 (envelope namespace, header role/relay/
mustUnderstand attributes, media type, fault codes). Driver/Proxy/Router
gain a soap_version accessor (default SOAPVersion1_1, zero behavior
change unless explicitly set to SOAPVersion1_2).

Envelope/header: SOAPEnvelope/SOAPHeader/SOAPBody derive their element
namespace from the configured version instead of hardcoded 1.1 constants.
SOAP 1.1's "actor" header attribute is renamed "role" in 1.2, which also
adds a "relay" attribute 1.1 has no equivalent for.

Fault model: SOAP 1.2 replaces 1.1's flat faultcode/faultstring/
faultactor/detail with a nested Code{Value,Subcode?}+Reason{Text}+Node?+
Role?+Detail? shape (SOAP12Fault). FaultError reads either shape into
the same reader names; Router#fault branches on soap_version to build
the right one.

HTTP transport: SOAP 1.2 folds the SOAPAction value into the
Content-Type's "action" parameter and drops the separate SOAPAction
header entirely (1.1 keeps both). StreamHandler/Proxy/Router/Soaplet all
thread soap_version through to build/parse the right form.

WSDL binding: recognizes the SOAP 1.2 WSDL binding namespace
alongside the 1.1 one at all six dispatch points that previously only
recognized 1.1, and configures generated/runtime-built drivers'
soap_version accordingly based on which binding namespace actually
matched.

SOAP-with-Attachments (MIME multipart) also now honors soap_version:
MIMEMessage previously hardcoded "text/xml" for both the root part and
the outer multipart's own "type" parameter regardless of version. The
legacy SOAPAction header is still sent for attachment requests even
under 1.2 (where it's otherwise dropped) since action placement for
attachments+1.2 combined isn't settled by any spec this was checked
against, and real-world use of that combination is rare -- the same
pragmatic fallback Savon's own client uses unconditionally.

Verified with real live round trips throughout, not just unit tests:
a hand-built SOAP 1.2 envelope round-tripping through Processor.marshal/
unmarshal; a real WEBrick StandaloneServer and Driver both configured
for SOAP 1.2 completing an actual RPC call over real HTTP, proving the
Content-Type-only action dispatch genuinely works; a WSDL2Ruby-generated
driver from a SOAP 1.2-bound WSDL fixture completing a real RPC call
end to end.

Full test:deep clean across all 5 parsers on both ruby:3.4.10 and
soap4r-legacy:1.9.3-p551 throughout development.
@rubyjedi
rubyjedi merged commit f28df68 into master Jul 16, 2026
13 of 19 checks passed
rubyjedi added a commit that referenced this pull request Jul 16, 2026
…2.2.0

README didn't yet mention the SOAP 1.2 or WS-Security support merged in
PR #34/#35. Version bump keeps a :git-sourced master checkout distinguishable
from the already-published 2.1.1 gem on RubyGems -- not a RubyGems release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant