SoapServer/Client now handle binary files correctly & large tests/fixtures update

Soap Server and Client were breaking binary files during transfer due to invalid Mime Message Parser. Now is it working fine with no errors, but the message parser is about to be rewritten into a better form.
This commit is contained in:
Petr Bechyně
2017-04-04 18:36:18 +02:00
parent 311f9e6d08
commit 564005da93
42 changed files with 1135 additions and 250 deletions

View File

@ -14,6 +14,7 @@ namespace BeSimple\SoapClient;
use BeSimple\SoapBundle\Soap\SoapAttachment;
use BeSimple\SoapCommon\Mime\PartFactory;
use BeSimple\SoapCommon\SoapRequest;
/**
* SoapResponseFactory for SoapClient. Provides factory function for SoapResponse object.
@ -50,7 +51,7 @@ class SoapResponseFactory
$response->setContentType($contentType);
if (count($attachments) > 0) {
$response->setAttachments(
self::createAttachmentParts($attachments)
PartFactory::createAttachmentParts($attachments)
);
}
@ -60,29 +61,26 @@ class SoapResponseFactory
/**
* Factory method for SoapClient\SoapResponse with SoapResponseTracingData.
*
* @param SoapRequest $soapRequest related request object
* @param string $content Content
* @param string $location Location
* @param string $action SOAP action
* @param string $version SOAP version
* @param string $contentType Content type header
* @param SoapResponseTracingData $tracingData Data value object suitable for tracing SOAP traffic
* @param SoapAttachment[] $attachments SOAP attachments
* @return SoapResponse
*/
public static function createWithTracingData(
SoapRequest $soapRequest,
$content,
$location,
$action,
$version,
$contentType,
SoapResponseTracingData $tracingData,
array $attachments = []
) {
$response = new SoapResponse();
$response->setRequest($soapRequest);
$response->setContent($content);
$response->setLocation($location);
$response->setAction($action);
$response->setVersion($version);
$response->setLocation($soapRequest->getLocation());
$response->setAction($soapRequest->getAction());
$response->setVersion($soapRequest->getVersion());
$response->setContentType($contentType);
if ($tracingData !== null) {
$response->setTracingData($tracingData);