Wraps WSDL Document/Literal Style service objects to hide SOAP request message abstraction from the actual service object.

When using the document/literal SOAP message pattern you end up with one object passed to your service methods that contains all the parameters of the method. This obviously leads to a problem since Zend\Soap\Wsdl tightly couples method parameters to request message parameters.

Example:

class MyCalculatorService { /** * @param int $x * @param int $y * @return int * public function add($x, $y) {} }

The document/literal wrapper pattern would lead php ext/soap to generate a single "request" object that contains $x and $y properties. To solve this a wrapper service is needed that extracts the properties and delegates a proper call to the underlying service.

The input variable from a document/literal SOAP-call to the client MyCalculatorServiceClient#add(10, 20) would lead PHP ext/soap to create the following request object:

$addRequest = new \stdClass; $addRequest->x = 10; $addRequest->y = 20;

This object does not match the signature of the server-side MyCalculatorService and lead to failure.

Also the response object in this case is supposed to be an array or object with a property "addResult":

$addResponse = new \stdClass; $addResponse->addResult = 30;

To keep your service object code free from this implementation detail of SOAP this wrapper service handles the parsing between the formats.

example <code> $service = new MyCalculatorService(); $soap = new \Zend\Soap\Server($wsdlFile); $soap->setObject(new \Zend\Soap\Server\DocumentLiteralWrapper($service)); $soap->handle(); </code>

 Methods

Proxy method that does the heavy document/literal decomposing.

__call(string $method, array $args) : mixed

Parameters

$method

string

$args

array

Returns

mixed

Pass Service object to the constructor

__construct(object $object) 

Parameters

$object

object

_assertOnlyOneArgument()

_assertOnlyOneArgument(array $args) 

Parameters

$args

array

Exceptions

\Zend\Soap\Exception\UnexpectedValueException

_assertServiceDelegateHasMethod()

_assertServiceDelegateHasMethod(string $method) 

Parameters

$method

string

Exceptions

\Zend\Soap\Exception\BadMethodCallException

Returns result message content

_getResultMessage(string $method, mixed $ret) : array

Parameters

$method

string

$ret

mixed

Returns

array

Parse the document/literal wrapper into arguments to call the real service.

_parseArguments(string $method, object $document) : array

Parameters

$method

string

$document

object

Exceptions

\Zend\Soap\Exception\UnexpectedValueException

Returns

array

 Properties

 

$object

$object : object

 

$reflection

$reflection : \ReflectionObject