Skip to content

Commit aee0cfc

Browse files
committed
Expose soapOperation array as context attribute on serializer
1 parent 9243a4f commit aee0cfc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function __call(string $functionName, array $args)
131131

132132
$bag = new HeadersOutgoing($headers);
133133
$context = SerializationContext::create()->setAttribute('headers_outgoing', $bag);
134-
$context->setAttribute('soapAction', $soapOperation['action']);
134+
$context->setAttribute('soapOperation', $soapOperation);
135135
$context->setAttribute('soapEndpoint', $this->serviceDefinition['endpoint']);
136136

137137
$xmlMessage = $this->serializer->serialize($message, 'xml', $context);

tests/Client/Client12RequestResponsesTest.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use GuzzleHttp\Psr7\Response;
2121
use JMS\Serializer\Context;
2222
use JMS\Serializer\GraphNavigator;
23-
use JMS\Serializer\Handler\HandlerRegistryInterface;
2423
use Symfony\Component\EventDispatcher\EventDispatcher;
2524

2625
class Client12RequestResponsesTest extends RequestResponsesTest
@@ -408,9 +407,11 @@ public function testSerializerContextParametersAreAdded()
408407
function($visitor, \Ex\SoapEnvelope12\Messages\GetSimpleInput $obj, array $type, Context $context) {
409408

410409
self::assertTrue($context->hasAttribute('soapEndpoint'), 'The "soapEndpoint" attribute was not found on the context object');
411-
self::assertTrue($context->hasAttribute('soapAction'), 'The "soapAction" attribute was not found on the context object');
412410
self::assertEquals('http://www.example.org/12', $context->getAttribute('soapEndpoint'));
413-
self::assertEquals('http://www.example.org/test/getSimple', $context->getAttribute('soapAction'));
411+
412+
self::assertTrue($context->hasAttribute('soapOperation'), 'The "soapOperation" attribute was not found on the context object');
413+
self::assertIsArray($context->getAttribute('soapOperation'));
414+
self::assertEquals('http://www.example.org/test/getSimple', $context->getAttribute('soapOperation')['action']);
414415

415416
throw new SerializerHandlerAssertionsWereExecuted('Stop serialization, test has finished');
416417
}

0 commit comments

Comments
 (0)