Skip to content

Resolve per-operation SOAP endpoints from WSDL ports - #138

Merged
pcai merged 2 commits into
mainfrom
feature/per-port-endpoints
Sep 17, 2026
Merged

pcai merged 2 commits into
mainfrom
feature/per-port-endpoints

Conversation

@pcai

@pcai pcai commented Sep 17, 2026

Copy link
Copy Markdown
Member

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.

  • Add Wasabi::ServicePorts, which parses every wsdl:port (name, binding, address, SOAP version) and every wsdl:binding into a binding -> portType map. It lives in its own class to keep Parser at its documented size limit.
  • Add Document#endpoint_for_operation(name, soap_version:), which walks operation -> portType -> binding -> port and returns that port's address.
  • 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 nothing matches, so SOAP 1.2-only WSDLs still route correctly under savon's default SOAP 1.1. Non-SOAP ports (e.g. http:address) are never returned. Returns nil only when the operation has no SOAP ports.
  • Document#endpoint keeps its exact legacy behavior.

Pairs with the savon-side wiring in savonrb/savon (operation-aware endpoint lookup).

Verified: bundle exec standardrb clean; bundle exec rspec 106 examples, 0 failures.

@coveralls

coveralls commented Sep 17, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 97.632% (+0.2%) from 97.46% — feature/per-port-endpoints into main

@pcai
pcai force-pushed the feature/per-port-endpoints branch from 9896d4b to 86fe679 Compare September 17, 2026 05:04
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
pcai force-pushed the feature/per-port-endpoints branch from 86fe679 to c3aef6c Compare September 17, 2026 05:25
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.
Comment thread lib/wasabi/document.rb
@pcai
pcai merged commit 23b6781 into main Sep 17, 2026
51 checks passed
@pcai
pcai deleted the feature/per-port-endpoints branch September 17, 2026 23:49
@pcai pcai mentioned this pull request Sep 18, 2026
pcai added a commit that referenced this pull request Sep 18, 2026
Release Wasabi 5.2.0.

- Resolve each operation to its WSDL port SOAP endpoint (#138)
- Parse operation faults and expose the raw operation name (#121)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants