From 461675042a6e3d40036ff82bd1dfdff42098ab2a Mon Sep 17 00:00:00 2001 From: Andreas Schamberger Date: Fri, 30 Aug 2013 22:07:44 +0200 Subject: [PATCH] fix soap header handling --- src/BeSimple/SoapClient/SoapClient.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/BeSimple/SoapClient/SoapClient.php b/src/BeSimple/SoapClient/SoapClient.php index b8a75c7..5476488 100644 --- a/src/BeSimple/SoapClient/SoapClient.php +++ b/src/BeSimple/SoapClient/SoapClient.php @@ -138,10 +138,18 @@ class SoapClient extends \SoapClient private function __doHttpRequest(SoapRequest $soapRequest) { // HTTP headers - $headers = array( - 'Content-Type:' . $soapRequest->getContentType(), - 'SOAPAction: "' . $soapRequest->getAction() . '"', - ); + $soapVersion = $soapRequest->getVersion(); + $soapAction = $soapRequest->getAction(); + if (SOAP_1_1 == $soapVersion) { + $headers = array( + 'Content-Type:' . $soapRequest->getContentType(), + 'SOAPAction: "' . $soapAction . '"', + ); + } else { + $headers = array( + 'Content-Type:' . $soapRequest->getContentType() . '; action="' . $soapAction . '"', + ); + } $location = $soapRequest->getLocation(); $content = $soapRequest->getContent();