Resolve per-operation SOAP endpoints from WSDL ports - #138
Merged
Merged
Conversation
pcai
force-pushed
the
feature/per-port-endpoints
branch
from
September 17, 2026 05:04
9896d4b to
86fe679
Compare
Wasabi only exposed the first service port's address, so clients could never route an operation to the port that serves it (savonrb/savon#879). Add Wasabi::ServicePorts, which parses every wsdl:port (name, binding, address, SOAP version) and every wsdl:binding into a binding -> portType map, and resolves the address of the port serving a given operation by walking operation -> portType -> binding -> port, optionally filtered by SOAP version. It lives in its own class because the Parser is already at its documented size limit. Document#endpoint_for_operation delegates to it; Document#endpoint keeps its legacy first-port behavior.
pcai
force-pushed
the
feature/per-port-endpoints
branch
from
September 17, 2026 05:25
86fe679 to
c3aef6c
Compare
Wasabi only exposed the first service port's address, so clients could never route an operation to the port that serves it (savonrb/savon#879). Add Wasabi::ServicePorts, which parses every wsdl:port (name, binding, address, SOAP version) and every wsdl:binding into a binding -> portType map, and resolves the address of the port serving a given operation by walking operation -> portType -> binding -> port. It lives in its own class because the Parser is already at its documented size limit. The requested SOAP version is a preference, not a filter: a port for that version wins, but the operation's first SOAP port is returned when no port matches, so SOAP 1.2-only WSDLs still route correctly under savon's default SOAP 1.1 setting. Non-SOAP ports (e.g. http:address) are never returned. Document#endpoint_for_operation delegates to it; Document#endpoint keeps its legacy first-port behavior.
Merged
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.
Wasabi only exposed the first service port's address, so multi-port WSDLs (e.g. the Juniper booking engine WSDL in savonrb/savon#879) could never route an operation to the port that serves it.
Wasabi::ServicePorts, which parses everywsdl:port(name, binding, address, SOAP version) and everywsdl:bindinginto a binding -> portType map. It lives in its own class to keepParserat its documented size limit.Document#endpoint_for_operation(name, soap_version:), which walks operation -> portType -> binding -> port and returns that port's address.http:address) are never returned. Returns nil only when the operation has no SOAP ports.Document#endpointkeeps its exact legacy behavior.Pairs with the savon-side wiring in savonrb/savon (operation-aware endpoint lookup).
Verified:
bundle exec standardrbclean;bundle exec rspec106 examples, 0 failures.