Releases: phpro/soap-client
Version 6.0.0
What's changed
- PHP 8.4 is now the minimum required version (PHP 8.3 support dropped)
- Replaced monolithic
php-standard-library/php-standard-librarywith standalone packages (^6.1) - Updated all php-soap packages to their latest versions
- Removed the monolithic PSL package entirely from the dependency tree
Dependency changes
| Package | v5 | v6 |
|---|---|---|
| php | ~8.3.0 || ~8.4.0 || ~8.5.0 | ~8.4.0 || ~8.5.0 |
| php-standard-library | monolithic ^3-6 | standalone packages ^6.1 |
| php-soap/cached-engine | ~0.6 | ~0.8 |
| php-soap/encoding | ~0.28 | ~0.32 |
| php-soap/engine | ^2.19 | ^2.20 |
| php-soap/psr18-transport | ^1.7 | ^2.0 |
| php-soap/wsdl-reader | ~0.31 | ~0.32 |
Breaking changes
PHP 8.4 minimum
PHP 8.3 is no longer supported. Upgrade to PHP 8.4+ before updating.
php-soap/psr18-transport 2.0 (from 1.x)
The biggest user-facing change. All DOM types migrated to PHP 8.4's modern DOM API:
DOMDocument->Dom\XMLDocumentDOMElement->Dom\ElementDOMNode->Dom\Node
If you wrote custom middleware or manipulators that touch DOM objects, you need to update:
// Before (v5):
use Soap\Psr18Transport\Xml\XmlMessageManipulator;
$manipulator = new XmlMessageManipulator(function (\DOMDocument $dom): void {
// ...
});
// After (v6):
$manipulator = new XmlMessageManipulator(function (\Dom\XMLDocument $dom): void {
// ...
});// Before (v5):
$middleware = new SoapHeaderMiddleware(fn(\DOMNode $node): \DOMElement => /* ... */);
// After (v6):
$middleware = new SoapHeaderMiddleware(fn(\Dom\Node $node): \Dom\Element => /* ... */);php-soap/encoding 0.32 (from 0.31)
Element::fromDOMElement()andElement::element()now accept/returnDom\Elementinstead ofDOMElement- All decoder/encoder type hints use
Dom\namespace equivalents - Attribute methods return
nullfor missing values (previously empty strings)
php-soap/wsdl-reader 0.32 (from 0.31)
- If upgrading from <0.29: regenerate types if your webservice uses anonymous complexTypes
PSL standalone packages
The monolithic php-standard-library/php-standard-library has been replaced with standalone packages:
php-standard-library/dict
php-standard-library/foundation
php-standard-library/iter
php-standard-library/option
php-standard-library/result
php-standard-library/str
php-standard-library/type
php-standard-library/vec
This should not affect end users unless you depend on PSL classes being available transitively.
Upgrade steps
- Ensure you're running PHP 8.4+
- Update
composer.json:composer require phpro/soap-client:^6.0 - Search your codebase for
DOMDocument,DOMElement,DOMNodeusage in SOAP middleware/manipulators and migrate toDom\XMLDocument,Dom\Element,Dom\Node - If using php-soap/encoding directly: update any
Element::fromDOMElement()calls
What's Changed
Full Changelog: 5.0.0...6.0.0
Version 5.0.0
V5 overhauls the code generation configuration system with proper value objects, introduces XML namespace-aware type mapping, customizable coding standards, and improved default value handling for generated code.
Upgrading
composer require 'phpro/soap-client:^5.0.0-beta1@beta' --update-with-dependenciesYou'll need to update your code generation configuration file.
For a step-by-step plan, you can follow the instructions at:
https://github.com/phpro/soap-client/blob/v5.x/UPGRADING.md#v4-to-v5
What's new
Configuration overhaul
The Config class no longer uses individual string setters. Instead, dedicated value objects — Destination, ClientConfig, ClassMapConfig, and TypeNamespaceMap — replace the old setTypeNamespace(), setTypeDestination(), setClientName(), etc. methods. The ConfigInterface has been removed.
TypeNamespaceMap: XML namespace-aware type mapping
A new TypeNamespaceMap allows you to map XML namespaces (xmlns) to specific PHP namespace destinations. This is useful when a WSDL defines types across multiple XML namespaces and you want to organize them into separate directories.
You can use explicit withMapping() calls, a built-in PrefixBasedTypeNamespaceStrategy for automatic resolution, or combine both. The generate:config command now detects xmlns namespaces from your WSDL and suggests mappings in the generated config.
Duplicate type strategies (IntersectDuplicateTypesStrategy and RemoveDuplicateTypesStrategy) are now namespace-aware — types that map to different PHP namespaces are no longer considered duplicates.
Coding standards strategy
A new CodingStandardsStrategyInterface lets you customize naming conventions for all generated code. By default, DefaultCodingStandardsStrategy is used, which matches existing behavior — no changes required for existing users.
Configure it via Config::setCodingStandards(). Context classes (TypeContext, PropertyContext, ClientMethodContext, ClassMapContext) now require CodeGeneratorContext as an additional constructor parameter. Property gains new convenience methods methodName() and parameterName() that use the configured coding standards.
Constructor and property default values
The old PropertyDefaultsAssembler has been removed. Its functionality is now built into PropertyAssembler and ConstructorAssembler via a new DefaultValuesStrategy enum:
OptionalOnly(new default) — Only nullable/optional properties get= nullAll(previous default) — All scalars get zero-value defaultsNone— No defaults applied
What's Changed
- Make it possible to configure a mapping of type namespaces based on xmlns by @veewee in #599
- Introduce DefaultValuesStrategy for constructor & property defaults by @veewee in #601
- Introduce CodingStandardsStrategy for customizable naming conventions by @veewee in #602
- feat: add support for azjezz/psl@5.0 by @EJTJ3 in #603
- feat: replace azjezz/psl with php-standard-library/php-standard-library by @veewee in #606
Full Changelog: 4.6.0...5.0.0
Version 4.8.0
What's Changed
Full Changelog: 4.7.0...4.8.0
Version 5.0.0-beta2
What's Changed
Full Changelog: 5.0.0-beta1...5.0.0-beta2
Version 4.7.0
5.0.0-beta1
❗ This pre-release is experimental ❗
V5 overhauls the code generation configuration system with proper value objects, introduces XML namespace-aware type mapping, customizable coding standards, and improved default value handling for generated code.
We decided to pre-launch at this point in order to get some feedback from you.
Feel free to play around with it and give us feedback!
Upgrading
composer require 'phpro/soap-client:^5.0.0-beta1@beta' --update-with-dependenciesYou'll need to update your code generation configuration file.
For a step-by-step plan, you can follow the instructions at:
https://github.com/phpro/soap-client/blob/v5.x/UPGRADING.md#v4-to-v5
What's new
Configuration overhaul
The Config class no longer uses individual string setters. Instead, dedicated value objects — Destination, ClientConfig, ClassMapConfig, and TypeNamespaceMap — replace the old setTypeNamespace(), setTypeDestination(), setClientName(), etc. methods. The ConfigInterface has been removed.
TypeNamespaceMap: XML namespace-aware type mapping
A new TypeNamespaceMap allows you to map XML namespaces (xmlns) to specific PHP namespace destinations. This is useful when a WSDL defines types across multiple XML namespaces and you want to organize them into separate directories.
You can use explicit withMapping() calls, a built-in PrefixBasedTypeNamespaceStrategy for automatic resolution, or combine both. The generate:config command now detects xmlns namespaces from your WSDL and suggests mappings in the generated config.
Duplicate type strategies (IntersectDuplicateTypesStrategy and RemoveDuplicateTypesStrategy) are now namespace-aware — types that map to different PHP namespaces are no longer considered duplicates.
Coding standards strategy
A new CodingStandardsStrategyInterface lets you customize naming conventions for all generated code. By default, DefaultCodingStandardsStrategy is used, which matches existing behavior — no changes required for existing users.
Configure it via Config::setCodingStandards(). Context classes (TypeContext, PropertyContext, ClientMethodContext, ClassMapContext) now require CodeGeneratorContext as an additional constructor parameter. Property gains new convenience methods methodName() and parameterName() that use the configured coding standards.
Constructor and property default values
The old PropertyDefaultsAssembler has been removed. Its functionality is now built into PropertyAssembler and ConstructorAssembler via a new DefaultValuesStrategy enum:
OptionalOnly(new default) — Only nullable/optional properties get= nullAll(previous default) — All scalars get zero-value defaultsNone— No defaults applied
What's Changed
- Introduce TypeNamespaceMap strategy system by @veewee in #599
- Introduce constructor & property default values with ScalarDefaultProvider by @veewee in #601
- Introduce CodingStandardsStrategy for customizable naming conventions by @veewee in #602
Full Changelog: 4.6.0...5.0.0-beta1
Version 4.6.0
Version 4.5.0
What's Changed
- Update ClientConstructorAssembler to use type instead of phpdoc by @ayrtonandino in #595
New Contributors
- @ayrtonandino made their first contribution in #595
Full Changelog: 4.4.1...4.5.0
Version 4.4.1
What's Changed
Full Changelog: 4.4.0...4.4.1
Version 4.4.0
What's Changed
Full Changelog: 4.3.0...4.4.0