-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #524 from veewee/soap-encoder
Prepare soap-client for new php-soap/encoding package
- Loading branch information
Showing
71 changed files
with
647 additions
and
914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,48 @@ | ||
# Driver metadata | ||
|
||
## Dealing with ext-soap issues | ||
|
||
### Duplicate types | ||
|
||
Ext-soap does not add any namespace or unique identifier to the types it knows. | ||
You can read more about this in the [known ext-soap issues](../known-issues/ext-soap.md#duplicate-typenames) section. | ||
Therefore, we added some strategies to deal with duplicate types: | ||
XSDs can have both internal and external types making that the names of the type can be non-unique in a given XML namespace. | ||
It might not be possible to generate unique types for all types in the WSDL. | ||
Therefore, we added some strategies to deal with duplicate types by default. | ||
|
||
This can be configured in the [client configuration](/docs/code-generation/configuration.md): | ||
|
||
**IntersectDuplicateTypesStrategy** | ||
|
||
Enabled by default when using `DefaultEngineFactory::create()`. | ||
Enabled by default when using `Config::create()`. | ||
|
||
This duplicate types strategy will merge all duplicate types into one big type which contains all properties. | ||
|
||
|
||
```php | ||
use Phpro\SoapClient\CodeGenerator\Config\Config; | ||
use Phpro\SoapClient\Soap\Metadata\Manipulators\DuplicateTypes\IntersectDuplicateTypesStrategy; | ||
use Phpro\SoapClient\Soap\Metadata\MetadataOptions; | ||
|
||
return Config::create() | ||
//... | ||
->setTypeMetadataOptions( | ||
MetadataOptions::empty()->withTypesManipulator(new IntersectDuplicateTypesStrategy()) | ||
) | ||
// ... | ||
``` | ||
|
||
**RemoveDuplicateTypesStrategy** | ||
|
||
This duplicate types strategy will remove all duplicate types it finds. | ||
|
||
You can overwrite the strategy on the `DefaultEngineFactory` object inside the client factory: | ||
|
||
```php | ||
<?php | ||
|
||
use Phpro\SoapClient\Soap\DefaultEngineFactory; | ||
use Phpro\SoapClient\Soap\ExtSoap\Metadata\Manipulators\DuplicateTypes\RemoveDuplicateTypesStrategy; | ||
use Phpro\SoapClient\CodeGenerator\Config\Config; | ||
use Phpro\SoapClient\Soap\Metadata\Manipulators\DuplicateTypes\RemoveDuplicateTypesStrategy; | ||
use Phpro\SoapClient\Soap\Metadata\MetadataOptions; | ||
|
||
$engine = DefaultEngineFactory::create( | ||
$options, $transport, | ||
MetadataOptions::empty()->withTypesManipulator( | ||
new RemoveDuplicateTypesStrategy() | ||
return Config::create() | ||
//... | ||
->setTypeMetadataOptions( | ||
MetadataOptions::empty()->withTypesManipulator(new RemoveDuplicateTypesStrategy()) | ||
) | ||
); | ||
// ... | ||
``` |
Oops, something went wrong.