Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 785 Bytes

validator.md

File metadata and controls

25 lines (17 loc) · 785 Bytes

Validator Subscriber

Require the symfony validator:

composer require symfony/validator

Register the validator subscriber:

use Phpro\SoapClient\Event\Subscriber\ValidatorSubscriber;

$eventDispatcher->addSubscriber(new ValidatorSubscriber($validator));

It is possible to use the Symfony validator component to validate your request objects before sending them to the server. Since some servers return very cryptographic errors, the validation of request components could save you a lot of time during development.

It will hook in to the Request event and will throw a RequestException when your request object doesn't contain valid data.

No more crappy error messages from the soap server!