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
|
* @param SoapAttachment[] $attachments SOAP attachments
|
||||||
* @return Part[]
|
* @return Part[]
|
||||||
*/
|
*/
|
||||||
private function createAttachmentParts(array $attachments = [])
|
private static function createAttachmentParts(array $attachments = [])
|
||||||
{
|
{
|
||||||
$parts = [];
|
$parts = [];
|
||||||
foreach ($attachments as $attachment) {
|
foreach ($attachments as $attachment) {
|
||||||
|
|
|
@ -146,7 +146,7 @@ class SoapServer extends \SoapServer
|
||||||
$handler = $this->soapServerOptions->getHandler();
|
$handler = $this->soapServerOptions->getHandler();
|
||||||
|
|
||||||
if ($this->soapOptions->hasAttachments()) {
|
if ($this->soapOptions->hasAttachments()) {
|
||||||
$this->injectAttachmentStorage($handler, $soapRequest, $this->soapOptions->getAttachmentType());
|
$this->injectAttachmentStorage($handler, $soapRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
@ -200,14 +200,14 @@ class SoapServer extends \SoapServer
|
||||||
return $soapResponse;
|
return $soapResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function injectAttachmentStorage(AttachmentsHandlerInterface $handler, SoapRequest $soapRequest, $attachmentType)
|
private function injectAttachmentStorage(AttachmentsHandlerInterface $handler, SoapRequest $soapRequest)
|
||||||
{
|
{
|
||||||
$attachments = [];
|
$attachments = [];
|
||||||
if ($soapRequest->hasAttachments()) {
|
if ($soapRequest->hasAttachments()) {
|
||||||
foreach ($soapRequest->getAttachments() as $attachment) {
|
foreach ($soapRequest->getAttachments() as $attachment) {
|
||||||
$attachments[] = new SoapAttachment(
|
$attachments[] = new SoapAttachment(
|
||||||
$attachment->getHeader('Content-Disposition', 'filename'),
|
$attachment->getHeader('Content-Disposition', 'filename'),
|
||||||
$attachmentType,
|
$attachment->getHeader('Content-Type'),
|
||||||
$attachment->getContent()
|
$attachment->getContent()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue