Handling SoapRequests/SoapResponse with attachments fix
This commit is contained in:
parent
052ab20d67
commit
f4a4619fe6
|
@ -52,7 +52,7 @@ class SoapResponseFactory
|
|||
* @param SoapAttachment[] $attachments SOAP attachments
|
||||
* @return Part[]
|
||||
*/
|
||||
private function createAttachmentParts(array $attachments = [])
|
||||
private static function createAttachmentParts(array $attachments = [])
|
||||
{
|
||||
$parts = [];
|
||||
foreach ($attachments as $attachment) {
|
||||
|
|
|
@ -146,7 +146,7 @@ class SoapServer extends \SoapServer
|
|||
$handler = $this->soapServerOptions->getHandler();
|
||||
|
||||
if ($this->soapOptions->hasAttachments()) {
|
||||
$this->injectAttachmentStorage($handler, $soapRequest, $this->soapOptions->getAttachmentType());
|
||||
$this->injectAttachmentStorage($handler, $soapRequest);
|
||||
}
|
||||
|
||||
ob_start();
|
||||
|
@ -200,14 +200,14 @@ class SoapServer extends \SoapServer
|
|||
return $soapResponse;
|
||||
}
|
||||
|
||||
private function injectAttachmentStorage(AttachmentsHandlerInterface $handler, SoapRequest $soapRequest, $attachmentType)
|
||||
private function injectAttachmentStorage(AttachmentsHandlerInterface $handler, SoapRequest $soapRequest)
|
||||
{
|
||||
$attachments = [];
|
||||
if ($soapRequest->hasAttachments()) {
|
||||
foreach ($soapRequest->getAttachments() as $attachment) {
|
||||
$attachments[] = new SoapAttachment(
|
||||
$attachment->getHeader('Content-Disposition', 'filename'),
|
||||
$attachmentType,
|
||||
$attachment->getHeader('Content-Type'),
|
||||
$attachment->getContent()
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue