From 51a971ed3379a5f000540569ae0d06f8ff445f4b Mon Sep 17 00:00:00 2001 From: Andreas Schamberger Date: Sun, 22 Apr 2012 18:08:40 +0200 Subject: [PATCH] added soap client specific soap kernel --- src/BeSimple/SoapClient/SoapClient.php | 6 ++-- src/BeSimple/SoapClient/SoapKernel.php | 47 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 src/BeSimple/SoapClient/SoapKernel.php diff --git a/src/BeSimple/SoapClient/SoapClient.php b/src/BeSimple/SoapClient/SoapClient.php index d264090..d0d99e8 100644 --- a/src/BeSimple/SoapClient/SoapClient.php +++ b/src/BeSimple/SoapClient/SoapClient.php @@ -13,7 +13,6 @@ namespace BeSimple\SoapClient; use BeSimple\SoapCommon\Helper; -use BeSimple\SoapCommon\SoapKernel; use BeSimple\SoapCommon\Converter\MtomTypeConverter; use BeSimple\SoapCommon\Converter\SwaTypeConverter; @@ -79,7 +78,7 @@ class SoapClient extends \SoapClient /** * Soap kernel. * - * @var \BeSimple\SoapCommon\SoapKernel + * @var \BeSimple\SoapClient\SoapKernel */ protected $soapKernel = null; @@ -252,7 +251,7 @@ class SoapClient extends \SoapClient /** * Get SoapKernel instance. * - * @return \BeSimple\SoapCommon\SoapKernel + * @return \BeSimple\SoapClient\SoapKernel */ public function getSoapKernel() { @@ -286,7 +285,6 @@ class SoapClient extends \SoapClient if (!isset($options['typemap'])) { $options['typemap'] = array(); } - $soapKernel = $this->soapKernel; $options['typemap'][] = array( 'type_name' => $converter->getTypeName(), 'type_ns' => $converter->getTypeNamespace(), diff --git a/src/BeSimple/SoapClient/SoapKernel.php b/src/BeSimple/SoapClient/SoapKernel.php new file mode 100644 index 0000000..949798e --- /dev/null +++ b/src/BeSimple/SoapClient/SoapKernel.php @@ -0,0 +1,47 @@ + + * (c) Francis Besset + * (c) Andreas Schamberger + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace BeSimple\SoapClient; + +use BeSimple\SoapCommon\SoapKernel as CommonSoapKernel; +use BeSimple\SoapCommon\SoapRequest; +use BeSimple\SoapCommon\SoapResponse; + +/** + * SoapKernel for Client. + * + * @author Andreas Schamberger + */ +class SoapKernel extends CommonSoapKernel +{ + /** + * {@inheritDoc} + */ + public function filterRequest(SoapRequest $request) + { + $request->setAttachments($this->attachments); + $this->attachments = array(); + + parent::filterRequest($request); + } + + /** + * {@inheritDoc} + */ + public function filterResponse(SoapResponse $response) + { + parent::filterResponse($response); + + $this->attachments = $response->getAttachments(); + } +} \ No newline at end of file