parser = $xmlParser ?: new XmlParser(); $this->honorResultWrapper = $honorResultWrapper; } public function __invoke( CommandInterface $command, ResponseInterface $response ) { $output = $this->api->getOperation($command->getName())->getOutput(); // Read the full payload, even in non-seekable streams $rawBody = AbstractParser::getBodyContents($response); // Just parse when the body is not empty $xml = !empty($rawBody) ? $this->parseXml($rawBody, $response) : null; // Empty request bodies should not be deserialized. if (is_null($xml)) { return new Result(); } if ($this->honorResultWrapper && $output['resultWrapper']) { $xml = $xml->{$output['resultWrapper']}; } return new Result($this->parser->parse($output, $xml)); } public function parseMemberFromStream( StreamInterface $stream, StructureShape $member, $response ) { $xml = $this->parseXml($stream, $response); return $this->parser->parse($member, $xml); } }