Skip to content

Releases: phpro/soap-client

Version 6.0.0

27 Mar 14:13
6.0.0
d052757

Choose a tag to compare

What's changed

  • PHP 8.4 is now the minimum required version (PHP 8.3 support dropped)
  • Replaced monolithic php-standard-library/php-standard-library with 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\XMLDocument
  • DOMElement -> Dom\Element
  • DOMNode -> 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() and Element::element() now accept/return Dom\Element instead of DOMElement
  • All decoder/encoder type hints use Dom\ namespace equivalents
  • Attribute methods return null for 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

  1. Ensure you're running PHP 8.4+
  2. Update composer.json: composer require phpro/soap-client:^6.0
  3. Search your codebase for DOMDocument, DOMElement, DOMNode usage in SOAP middleware/manipulators and migrate to Dom\XMLDocument, Dom\Element, Dom\Node
  4. If using php-soap/encoding directly: update any Element::fromDOMElement() calls

What's Changed

  • feat: bump PHP 8.4 minimum, update dependencies by @veewee in #608

Full Changelog: 5.0.0...6.0.0

Version 5.0.0

19 Mar 08:59
5.0.0

Choose a tag to compare

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-dependencies

You'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 = null
  • All (previous default) — All scalars get zero-value defaults
  • None — 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

19 Mar 08:57
4.8.0
dd60925

Choose a tag to compare

What's Changed

  • feat: replace azjezz/psl with php-standard-library/php-standard-library by @veewee in #606

Full Changelog: 4.7.0...4.8.0

Version 5.0.0-beta2

11 Mar 15:17
5.0.0-beta2

Choose a tag to compare

Version 5.0.0-beta2 Pre-release
Pre-release

What's Changed

  • feat: add support for azjezz/psl@5.0 by @EJTJ3 in #603

Full Changelog: 5.0.0-beta1...5.0.0-beta2

Version 4.7.0

11 Mar 15:13
4.7.0
e42dd62

Choose a tag to compare

What's Changed

  • feat: add support for azjezz/psl@5.0 by @EJTJ3 in #603

Full Changelog: 4.6.0...4.7.0

5.0.0-beta1

03 Mar 07:35
5.0.0-beta1
602b289

Choose a tag to compare

5.0.0-beta1 Pre-release
Pre-release

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-dependencies

You'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 = null
  • All (previous default) — All scalars get zero-value defaults
  • None — 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

28 Jan 08:56
4.6.0
1b14f81

Choose a tag to compare

What's Changed

  • feat: add support for symfony 8 by @EJTJ3 in #600

New Contributors

Full Changelog: 4.5.0...4.6.0

Version 4.5.0

05 Nov 13:16
4.5.0
5c90538

Choose a tag to compare

What's Changed

  • Update ClientConstructorAssembler to use type instead of phpdoc by @ayrtonandino in #595

New Contributors

Full Changelog: 4.4.1...4.5.0

Version 4.4.1

23 Oct 07:58
4.4.1
59b1e32

Choose a tag to compare

What's Changed

  • Dont fall back to simple base-type for simple enums. by @veewee in #593

Full Changelog: 4.4.0...4.4.1

Version 4.4.0

23 Oct 06:38
4.4.0
0081710

Choose a tag to compare

What's Changed

  • Fix xsd:language-like simple type generations. by @veewee in #592

Full Changelog: 4.3.0...4.4.0