Fixed issue #29

This commit is contained in:
Francis Besset 2013-02-27 17:06:00 +01:00
parent a50215b649
commit ea4d031084
2 changed files with 20 additions and 0 deletions

View File

@ -61,6 +61,16 @@ class RpcLiteralRequestMessageBinder implements MessageBinderInterface
foreach ($message->item as $complexType) { foreach ($message->item as $complexType) {
$array[] = $this->checkComplexType($phpType, $complexType); $array[] = $this->checkComplexType($phpType, $complexType);
} }
// See https://github.com/BeSimple/BeSimpleSoapBundle/issues/29
if (in_array('BeSimple\SoapCommon\Type\AbstractKeyValue', class_parents($phpType))) {
$assocArray = array();
foreach ($array as $keyValue) {
$assocArray[$keyValue->getKey()] = $keyValue->getValue();
}
$array = $assocArray;
}
} }
$message = $array; $message = $array;

View File

@ -46,6 +46,16 @@ class RpcLiteralResponseMessageBinder implements MessageBinderInterface
if ($isArray) { if ($isArray) {
$array = array(); $array = array();
// See https://github.com/BeSimple/BeSimpleSoapBundle/issues/29
if (is_array($message) && in_array('BeSimple\SoapCommon\Type\AbstractKeyValue', class_parents($phpType))) {
$keyValue = array();
foreach ($message as $key => $value) {
$keyValue[] = new $phpType($key, $value);
}
$message = $keyValue;
}
foreach ($message as $complexType) { foreach ($message as $complexType) {
$array[] = $this->checkComplexType($phpType, $complexType); $array[] = $this->checkComplexType($phpType, $complexType);
} }