- What is php-soap/encoding used for?
- php-soap/encoding is a low-level SOAP serialization component that converts PHP values into SOAP-compatible XML and decodes SOAP payloads back into PHP data. It provides reusable encoding and decoding primitives for envelopes, headers, faults, and typed values without requiring a full SOAP client. It is designed to sit beneath higher-level php-soap packages or custom SOAP tooling.
- Is php-soap/encoding a Laravel package?
- No. It is a framework-agnostic PHP library with no Laravel service provider, facade, config file, or transport layer. You can use it inside a Laravel application, but you must write the bindings, configuration, logging, retries, and HTTP client integration yourself. It is usually better treated as an internal dependency beneath an adapter or a higher-level SOAP package.
- How do I install php-soap/encoding in a Laravel project?
- Install it with Composer using composer require php-soap/encoding. Because the package is still 0.x and ships behavior changes in minor-style releases, pin an exact version in composer.json and read the changelog before every bump. There is no publishable Laravel config or migration step; PSR-4 autoloading is all you need.
- Which Laravel versions support php-soap/encoding?
- The package does not ship Laravel-specific integration, so it does not declare a Laravel version constraint. Compatibility depends on the PHP version and Composer requirements in its composer.json, plus your application's autoloading setup. Any Laravel app running a compatible PHP version can load it, but you should test against your target Laravel and PHP matrix.
- Does php-soap/encoding replace a SOAP client or WSDL loader?
- No. It is an encoding layer, not a SOAP client, so it does not provide WSDL resolution, HTTP transport, retries, or high-level error handling. For a full client stack, look at php-soap/client, php-soap/engine, or a Laravel wrapper such as code-distortion/laravel-soap. If you adopt php-soap/encoding directly, expect to own the transport and WSDL layers yourself.
- Can php-soap/encoding encode and decode SOAP envelopes, headers, and faults?
- Yes. The package supports SOAP envelopes, headers, faults, and typed values through its encoding and decoding API, including scalar, array, and complex data structures. It does not hide SOAP style decisions from you, so you still need to construct the correct SOAP 1.1 or 1.2 envelope and handle RPC/encoded versus document/literal details. Correct namespace and nil handling remain your responsibility.
- What are alternatives to php-soap/encoding?
- Alternatives include PHP's ext-soap for built-in SOAP client behavior, php-soap/client and php-soap/engine for higher-level SOAP stacks, and code-distortion/laravel-soap for a Laravel-oriented wrapper. Choose a higher-level package unless you specifically need custom serialization control. If you mix ext-soap and php-soap/encoding in one estate, validate wire output carefully because they can serialize the same logical payload differently.
- Is php-soap/encoding production-ready for Laravel apps?
- It is still a 0.x pre-1.0 component with a small adopter base, so treat it as production-capable only behind a bounded adapter and fixture-based tests. The 0.36.0 release shows positive maintenance signals, including external contributor fixes and benchmark-backed verification, but it also includes breaking behavior changes. Pin exact versions, monitor the changelog, and validate wire output against every counterparty, especially for nillable elements and attribute namespacing. The MIT license keeps a vendor fork viable, but forking a serializer is an ongoing maintenance cost.
- What breaking changes are in php-soap/encoding 0.36.0?
- 0.36.0 ships multiple breaking behavior changes in a minor-style bump, including a removed class, a changed lens API, changed attribute namespacing, changed nil-on-encode semantics, and changed exception propagation. Custom glue that implements ProvidesObjectEncoderLens or ProvidesObjectDecoderLens must be migrated from array lookup to the ElementLookup object with explicit miss handling. Treat every version change as potentially behavior-changing and pin exact versions until a stable 1.0 API exists.
- How should I test php-soap/encoding in a Laravel application?
- Wrap the library behind your own adapter interface and test that adapter with fixture-based encoding and decoding cases. Include byte-identical output assertions for envelopes, headers, faults, namespaces, and nillable elements, then add integration tests against strict XSD validation or real counterparties. Also test the upgrade path for custom lenses, because the 0.36.0 API changes are not portable across versions.