robrichards/wse-php
robrichards/wse-php is a PHP library that adds WS-Security to SOAP requests, offering XML signing, encryption and decryption, security tokens and timestamp support for secure, interoperable web service integrations.
Architecture fit
robrichards/wse-php is a low-level WS-Security plumbing library, not a Laravel package. It has no service provider, facade, config publishing, or container awareness. It decorates native ext/soap (SoapClient, SoapVar, SoapHeader) to add UsernameToken, Timestamp, BinarySecurityToken, and XML Digital Signature/Encryption via xmlseclibs.WsseSoapClient wrapper plus a factory resolved from the container, so application code never touches RobRichards\WsePhp\* classes directly.Http::withHeaders() cannot produce WS-Security envelopes, so teams expecting to reuse existing Http retry/middleware/telemetry patterns will be disappointed — those must be reimplemented around a blocking SOAP call.Integration feasibility
composer require robrichards/wse-php plus ext-soap and ext-openssl in the runtime image. No Laravel version constraints, no facade conflicts, no published assets. Typical effort for a first working signed request against a sandbox: 1–3 days.Technical risk
SoapClient instances and any per-request key material must not be shared across requests; treat the client as request-scoped and never as a singleton with mutable signature state.Timestamp elements typically carry a 5-minute TTL. Container clock drift and short-lived certs are the two most common production incidents for this class of integration.Key questions
UsernameToken (plaintext vs digest), X.509 signature, Timestamp, encryption, WS-Addressing? Each adds test surface..env?ext-soap present in all target images (local, CI, staging, prod, and any FaaS/container runtime)?Stack fit
ext-soap and ext-openssl enabled. No framework coupling, so it slots into any Laravel codebase without touching bootstrap/app.php or provider ordering.app/Integrations/{Partner}/ with a …Client that wraps WSSESoap, a …ClientFactory, a config/integrations/{partner}.php config file, and a queued Job per operation. This keeps SOAP mechanics out of controllers, Livewire components, and Filament resources.Http client or Saloon. Saloon is a good fit for REST and a poor fit here; wrapping it adds abstraction without solving the envelope-signing problem.Migration path
call(string $operation, array $payload): array entry point that normalizes faults into domain exceptions.new SoapClient(...) scattered in controllers with the wrapper, one call site at a time. There is no schema or data migration; the migration is behavioral.Compatibility
robrichards/xmlseclibs. Audit for a second copy pulled in by another package (composer why robrichards/xmlseclibs) and align versions.Http client, Guzzle, and any REST integrations in the same app; keep SOAP and REST clients separate in the directory structure so the distinction stays visible.Sequencing
.env keys, secrets manager wiring, cert/key placement, .gitignore hygiene for PEMs.WsseSoapClient, factory, SoapFault → typed exceptions, timeouts, WSDL cache settings.Maintenance
Support
openssl CLI verification of the envelope), and maintain captured request/response fixtures from the partner's sandbox.Scaling
soap.wsdl_cache (or ship local WSDL copies) to avoid a WSDL fetch on every request.connection_timeout and timeout values. A hung SOAP call inside a web request is a worker-exhaustion incident.Failure modes
Timestamp outside the partner's window; intermittent and confusing. Enforce NTP and monitor drift.SoapFault->detail.Ramp-up
ext/soap, and a poor general-purpose HTTP integration choice. Justify it only when a counterparty mandates WS-*.How can I help you explore Laravel packages today?