Skip to content

Commit ddadc19

Browse files
committed
Switch content type depending on SOAP version.
SOAP 1.1 uses a different content type than SOAP 1.2 so we should switch accordingly. Current version assumes 1.2.
1 parent a68b0f6 commit ddadc19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/VCR/LibraryHooks/Soap.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public function doRequest($request, $location, $action, $version, $one_way = 0)
5757
}
5858

5959
$vcrRequest = new Request('POST', $location);
60-
$vcrRequest->addHeader('Content-Type', 'application/soap+xml; charset=utf-8; action="' . $action . '"');
60+
$contentType = ($version == SOAP_1_2) ? 'application/soap+xml' : 'text/xml';
61+
$vcrRequest->addHeader('Content-Type', $contentType . '; charset=utf-8; action="' . $action . '"');
6162
$vcrRequest->setBody($request);
6263

6364
$handleRequestCallback = self::$handleRequestCallback;

0 commit comments

Comments
 (0)