Merge branch 'master' of https://github.com/sarunas/BeSimpleSoapBundle into sarunas-master

Conflicts:
	ServiceBinding/RpcLiteralResponseMessageBinder.php
This commit is contained in:
Francis Besset 2012-01-12 11:53:58 +01:00
commit e291afcba1
3 changed files with 16 additions and 12 deletions

View File

@ -96,6 +96,7 @@ class RpcLiteralRequestMessageBinder implements MessageBinderInterface
$value = $p->getValue($message); $value = $p->getValue($message);
} }
if (null !== $value) {
$value = $this->processType($type->getValue(), $value); $value = $this->processType($type->getValue(), $value);
if ($p->isPublic()) { if ($p->isPublic()) {
@ -103,6 +104,7 @@ class RpcLiteralRequestMessageBinder implements MessageBinderInterface
} else { } else {
$p->setValue($message, $value); $p->setValue($message, $value);
} }
}
if (!$type->isNillable() && null === $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())); throw new \SoapFault('SOAP_ERROR_COMPLEX_TYPE', sprintf('"%s:%s" cannot be null.', ucfirst(Wsdl::translateType($phpType)), $type->getName()));

View File

@ -81,6 +81,7 @@ class RpcLiteralResponseMessageBinder implements MessageBinderInterface
$value = $p->getValue($message); $value = $p->getValue($message);
} }
if (null !== $value) {
$value = $this->processType($type->getValue(), $value); $value = $this->processType($type->getValue(), $value);
if ($p->isPublic()) { if ($p->isPublic()) {
@ -88,6 +89,7 @@ class RpcLiteralResponseMessageBinder implements MessageBinderInterface
} else { } else {
$p->setValue($message, $value); $p->setValue($message, $value);
} }
}
if (!$type->isNillable() && null === $value) { if (!$type->isNillable() && null === $value) {
throw new \InvalidArgumentException(sprintf('"%s::%s" cannot be null.', $phpType, $type->getName())); throw new \InvalidArgumentException(sprintf('"%s::%s" cannot be null.', $phpType, $type->getName()));

View File

@ -133,7 +133,7 @@ class RpcLiteralRequestMessageBinderTest extends \PHPUnit_Framework_TestCase
); );
$result = $result['simple_arrays']; $result = $result['simple_arrays'];
$this->assertEquals(array(), $result->array1); $this->assertEquals(null, $result->array1);
$this->assertEquals(array(), $result->getArray2()); $this->assertEquals(array(), $result->getArray2());
$this->assertEquals($array, $result->getArray3()); $this->assertEquals($array, $result->getArray3());
} }