- How do I install econea/nusoap in a Laravel application?
- Install it with Composer using composer require econea/nusoap. There is no Laravel service provider or config file to publish, so you register the client yourself, typically by binding a configured nusoap_client instance in a service provider or resolving it from a small wrapper class. Keep credentials and endpoint URLs in config or environment variables rather than hardcoding them in the wrapper.
- What is econea/nusoap used for?
- It is a maintained fork of NuSOAP, a pure-PHP library for creating and consuming SOAP 1.1 web services with WSDL 1.1 and HTTP 1.0/1.1 support. In Laravel projects it is almost always used to talk to legacy counterparties such as banks, government APIs, and enterprise ERP or CRM systems that only expose SOAP. Treat it as a contained integration layer rather than a general HTTP client.
- Which PHP versions does econea/nusoap support?
- Historically the package supported PHP 5.6 through 8.5, and the 0.9.x line still covers older runtimes. Release v0.10.0 raised the floor to PHP 8.2 and added forward-compatibility fixes for PHP 8.5, including curl_close deprecations and non-canonical cast warnings. The README's broad version range therefore does not apply uniformly across releases.
- Does econea/nusoap work with Laravel 11 and Laravel 12?
- Yes, because Laravel 11 and 12 already require PHP 8.2 or newer, which matches the v0.10.0 platform floor. Laravel 9 and 10 projects are only viable if the actual runtime is PHP 8.2 or higher. Laravel version alone is no longer the deciding factor; your PHP runtime is.
- Is econea/nusoap v0.10.0 a breaking change for apps still on PHP 8.1?
- Yes. The PHP >= 8.2 requirement means Composer will hard-fail at install time for any service still running PHP 8.0 or 8.1, which blocks the upgrade to ^0.10.0. Those services must stay pinned to ^0.9.20 until their runtime is upgraded. The failure is deterministic and occurs before deployment, so inventory your runtimes first rather than discovering it in production.
- How do I fix character encoding issues with legacy SOAP endpoints using nusoap?
- In v0.10.0 you can call setCharEncoding on the client, for example setCharEncoding('ISO-8859-1'), to control request and response encoding per counterparty. This typically lets you delete hand-rolled utf8_encode and utf8_decode shims at the integration boundary, which were a common source of silent data corruption. Set it explicitly instead of relying on defaults when talking to older Windows-1252 systems.
- How do I handle SOAP faults with nusoap in Laravel?
- After each call, check the client's fault property and throw when it is set, and also catch nusoap_fault exceptions around the call itself. Convert both into a domain exception or RuntimeException so the rest of your Laravel application handles failures consistently, and log the faultstring with context. Avoid letting the raw nusoap error surface to users or queue workers.
- Does econea/nusoap require the PHP SOAP extension?
- No. NuSOAP is a pure-PHP implementation and does not depend on ext-soap, which is why it works on hosts where the native extension is unavailable or disabled. It does rely on standard XML and DOM functionality being present in your PHP build, so verify those before deploying. It also means you cannot mix ext-soap options into the client.
- How do I test nusoap SOAP calls inside a Laravel test suite?
- Wrap the client behind a small interface and bind a fake implementation in the container during tests, asserting on the arguments passed and returning canned SOAP responses or faults. That keeps your tests fast and free of network calls. The v0.10.0 release also added the project's first real test suite and a QA toolchain, but note that WS-Security paths do not appear to be covered, so verify those yourself.
- Is econea/nusoap actively maintained, and what are the alternatives?
- It is a maintained fork under contributte, with recent releases adding PHP 8.5 fixes, configurable character encoding, a first test suite, and PHPStan and CodeSniffer tooling (some CI jobs are configured to allow failure, so review diffs before adopting). The practical alternative for new code is PHP's native SoapClient where ext-soap is available, or phpro/soap-client for a more modern wrapper. Where the counterparty permits it, the strongest long-term option is still migrating away from SOAP toward REST, gRPC, or GraphQL.