diff --git a/ServiceBinding/RpcLiteralRequestMessageBinder.php b/ServiceBinding/RpcLiteralRequestMessageBinder.php index edef394..edcaecc 100644 --- a/ServiceBinding/RpcLiteralRequestMessageBinder.php +++ b/ServiceBinding/RpcLiteralRequestMessageBinder.php @@ -96,7 +96,9 @@ class RpcLiteralRequestMessageBinder implements MessageBinderInterface $value = $p->getValue($message); } - $value = $this->processType($type->getValue(), $value); + if ($value !== null) { + $value = $this->processType($type->getValue(), $value); + } if (!$type->isNillable() && null === $value) { throw new \SoapFault('SOAP_ERROR_COMPLEX_TYPE', sprintf('"%s:%s" cannot be null.', ucfirst(Wsdl::translateType($phpType)), $type->getName())); diff --git a/ServiceBinding/RpcLiteralResponseMessageBinder.php b/ServiceBinding/RpcLiteralResponseMessageBinder.php index 5cb6310..f894d97 100644 --- a/ServiceBinding/RpcLiteralResponseMessageBinder.php +++ b/ServiceBinding/RpcLiteralResponseMessageBinder.php @@ -82,7 +82,11 @@ class RpcLiteralResponseMessageBinder implements MessageBinderInterface $p->setAccessible(true); $value = $p->getValue($message); - $p->setValue($message, $this->processType($type->getValue(), $value)); + if ($value !== null) { + $value = $this->processType($type->getValue(), $value); + } + + $p->setValue($message, $value); } if (!$type->isNillable() && null === $value) {