Fix document literal binder for request and response

This commit is contained in:
Gianluigi 'cocciagialla' Mammarella 2019-04-10 07:22:34 +02:00
parent 2771991fc0
commit c4118855de
2 changed files with 9 additions and 10 deletions

View File

@ -11,13 +11,14 @@
namespace BeSimple\SoapBundle\ServiceBinding; namespace BeSimple\SoapBundle\ServiceBinding;
use BeSimple\SoapBundle\ServiceDefinition\Method; use BeSimple\SoapBundle\ServiceDefinition\Method;
use BeSimple\SoapCommon\Definition\Type\TypeRepository;
/** /**
* @author Christian Kerl <christian-kerl@web.de> * @author Christian Kerl <christian-kerl@web.de>
*/ */
class DocumentLiteralWrappedRequestMessageBinder implements MessageBinderInterface class DocumentLiteralWrappedRequestMessageBinder implements MessageBinderInterface
{ {
public function processMessage(Method $messageDefinition, $message) public function processMessage(Method $messageDefinition, $message, TypeRepository $typeRepository)
{ {
if(count($message) > 1) { if(count($message) > 1) {
throw new \InvalidArgumentException(); throw new \InvalidArgumentException();
@ -26,10 +27,10 @@ class DocumentLiteralWrappedRequestMessageBinder implements MessageBinderInterfa
$result = array(); $result = array();
$message = $message[0]; $message = $message[0];
foreach($messageDefinition->getArguments() as $argument) { foreach($messageDefinition->getInput()->all() as $argument) {
$result[$argument->getName()] = $message->{$argument->getName()}; $result[$argument->getName()] = $message;
} }
return $result; return $result;
} }
} }

View File

@ -11,17 +11,15 @@
namespace BeSimple\SoapBundle\ServiceBinding; namespace BeSimple\SoapBundle\ServiceBinding;
use BeSimple\SoapBundle\ServiceDefinition\Method; use BeSimple\SoapBundle\ServiceDefinition\Method;
use BeSimple\SoapCommon\Definition\Type\TypeRepository;
/** /**
* @author Christian Kerl <christian-kerl@web.de> * @author Christian Kerl <christian-kerl@web.de>
*/ */
class DocumentLiteralWrappedResponseMessageBinder implements MessageBinderInterface class DocumentLiteralWrappedResponseMessageBinder implements MessageBinderInterface
{ {
public function processMessage(Method $messageDefinition, $message) public function processMessage(Method $messageDefinition, $message, TypeRepository $typeRepository)
{ {
$result = new \stdClass(); return $message;
$result->{$messageDefinition->getName().'Result'} = $message;
return $result;
} }
} }