php-soap/encoding
A PHP library for SOAP encoding and decoding, converting PHP values to and from SOAP XML. It provides the encoding layer for SOAP clients and servers, with support for envelopes, headers, faults, and typed values through a clean, framework-agnostic API.
xsi:type, multi-ref graphs, arrays). It informs the decision to not hand-roll XML encoding and instead compose a maintained codec — and 0.36.0 strengthens that case: a 3 MB payload decode dropped from ~7.2 s to ~0.38 s (‑94.7%), work we would never have prioritized in-house.php-soap/* family (wsdl-reader, http-client, encoding) versus ext-soap, Laminas SOAP, or Symfony-oriented alternatives — with the caveat that this release moves further from ext-soap parity in one documented area (see below), so "drop-in equivalence" is not the right framing.Consider it when:
xsi:type.ext-soap is insufficient or unavailable (custom transports, non-WSDL-driven calls, testability, or environments where the extension can't be installed).php-soap/* ecosystem and want the encoding concern handled by a dedicated, single-responsibility library.Look elsewhere when:
ext-soap already works — the extra dependency buys little, and you'd inherit upgrade churn for no gain.ext-soap output as a hard requirement. 0.36.0 intentionally diverges: absent optional nillable properties are omitted rather than sent as xsi:nil (unless explicitly set to null), and attributes declared via ref are written in their own namespace (e.g. tns:code) instead of matching ext-soap. Verify against partner WSDLs before swapping out an ext-soap path.If you adopt, capture these 0.36.0 migration items in the plan: nillable-element omission (#79); ElementLookup replacing the lookup array in custom ProvidesObjectDecoderLens and the removal of DocumentToLookupArrayReader (#80); strict namespace matching for attributes; lens exceptions now surfacing as EncodingException instead of decoding to null (#84); NullValueAware / NullValueHandling for encoder null semantics (#83); and the php-soap/wsdl-reader ~0.34 + veewee/xml ^4.14 + veewee/reflecta ^1.2 constraint alignment, which must be upgraded as a set.
For executives: We need to integrate with partner systems that still speak SOAP. Rather than build XML/SOAP serialization ourselves — a well-specified but error-prone problem — we adopt a small, MIT-licensed, single-purpose library and compose it with a WSDL reader and HTTP client. Licensing cost is zero, scope is narrow, and the code is small enough that forking is a realistic contingency. The latest release is a meaningful de-risking event on performance: large-payload decoding got roughly 5–20× faster, which improves our batch windows and compute footprint without a rewrite. The trade-off is that the library is pre-1.0 and this release contains breaking changes, so we pin versions, hold a regression suite of real partner payloads, and schedule a small upgrade window per bump. Net: a roadmap item delivered without a vendor contract, at the cost of disciplined dependency hygiene we already apply elsewhere.
For engineering: Focused codec, not a framework — encoding/decoding of typed values, multi-ref graphs, arrays and xsi:type behind a small API. 0.36.0 removes intermediate exception-based control flow, decodes through a new ElementLookup, and writes via plain XMLWriter; output is byte-identical on the published benchmarks, with 42–95% gains on 3 MB payloads. It composes with php-soap/wsdl-reader and php-soap/http-client and unit-tests independently of transport. Treat it as a breaking release: update custom lenses to ElementLookup ($lookup->element(...) / $lookup->attribute(...)), replace DocumentToLookupArrayReader::fromElement() with ElementLookup::fromElement(), make lenses handle their own misses (reflecta optional() / optional_property()) since failures now throw EncodingException, and review null/nillable semantics against the new NullValueAware / NullValueHandling behavior. Watch the two deliberate ext-soap divergences (omitted nillable elements; ref attributes in their own namespace) if you're behind an A/B comparison. Star count still misleads — it's a split sub-package; judge on Packagist adoption, the now-visible responsiveness to external bug reports, test coverage and changelog health. Recommendation stands and is now better supported: spike it against two real partner WSDLs (one encoded, one literal), snapshot golden output on 0.35.x before upgrading, and diff before committing.
How can I help you explore Laravel packages today?