From 63d3611006fa338978f9794943278c5f955d0e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Dubinskas?= Date: Wed, 11 Jan 2012 15:11:55 +0200 Subject: [PATCH 1/2] Fix to allow ComplexType to be nillable --- ServiceBinding/RpcLiteralRequestMessageBinder.php | 4 +++- ServiceBinding/RpcLiteralResponseMessageBinder.php | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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) { From 383d24e86b4090cc1b185c0a1b6013ece0d5e649 Mon Sep 17 00:00:00 2001 From: Vytautas Gimbutas Date: Thu, 12 Jan 2012 11:22:08 +0200 Subject: [PATCH 2/2] Fix for ComplexType --- ServiceBinding/RpcLiteralRequestMessageBinder.php | 1 + 1 file changed, 1 insertion(+) diff --git a/ServiceBinding/RpcLiteralRequestMessageBinder.php b/ServiceBinding/RpcLiteralRequestMessageBinder.php index edcaecc..210d6a2 100644 --- a/ServiceBinding/RpcLiteralRequestMessageBinder.php +++ b/ServiceBinding/RpcLiteralRequestMessageBinder.php @@ -98,6 +98,7 @@ class RpcLiteralRequestMessageBinder implements MessageBinderInterface if ($value !== null) { $value = $this->processType($type->getValue(), $value); + $p->setValue($message, $value); } if (!$type->isNillable() && null === $value) {