Fix to allow ComplexType to be nillable

This commit is contained in:
Šarūnas Dubinskas 2012-01-11 15:11:55 +02:00
parent f0031e8923
commit 63d3611006
2 changed files with 8 additions and 2 deletions

View File

@ -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()));

View File

@ -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) {