Skip to content

Commit 87c468b

Browse files
author
Alex Paliarush
committed
MAGETWO-53431: [GITHUB] SOAP API Encoding Object has no 'label' property #4630
1 parent 81b2b7c commit 87c468b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

app/code/Magento/Webapi/Controller/Soap/Request/Handler.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Webapi\Controller\Soap\Request;
77

8+
use Magento\Framework\Api\ExtensibleDataInterface;
9+
use Magento\Framework\Api\MetadataObjectInterface;
810
use Magento\Framework\Api\SimpleDataObjectConverter;
911
use Magento\Framework\Webapi\Authorization;
1012
use Magento\Framework\Exception\AuthorizationException;
@@ -155,7 +157,11 @@ protected function _prepareResponseData($data, $serviceClassName, $serviceMethod
155157
} elseif (is_array($data)) {
156158
$dataType = substr($dataType, 0, -2);
157159
foreach ($data as $key => $value) {
158-
if ($value instanceof $dataType) {
160+
if ($value instanceof $dataType
161+
// the following two options are supported for backward compatibility
162+
|| $value instanceof ExtensibleDataInterface
163+
|| $value instanceof MetadataObjectInterface
164+
) {
159165
$result[] = $this->_dataObjectConverter
160166
->convertKeysToCamelCase($this->_dataObjectProcessor->buildOutputDataArray($value, $dataType));
161167
} else {

app/code/Magento/Webapi/Test/Unit/Controller/Soap/Request/HandlerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public function testCall()
104104
$this->_dataObjectConverter->expects($this->once())
105105
->method('convertStdObjectToArray')
106106
->will($this->returnValue(['field' => 1]));
107+
$this->_methodsMapProcessorMock->method('getMethodReturnType')->willReturn('string');
107108
$operationName = 'soapOperation';
108109
$className = \Magento\Framework\DataObject::class;
109110
$methodName = 'testMethod';

0 commit comments

Comments
 (0)