UnitTests are now located in tests directory & tiny improvements
This commit is contained in:
35
tests/Fixtures/Attachment/Attachment.php
Normal file
35
tests/Fixtures/Attachment/Attachment.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures\Attachment;
|
||||
|
||||
class Attachment
|
||||
{
|
||||
/**
|
||||
* @var string $fileName
|
||||
*/
|
||||
public $fileName;
|
||||
|
||||
/**
|
||||
* @var string $content
|
||||
*/
|
||||
public $contentType;
|
||||
|
||||
/**
|
||||
* @var string $content
|
||||
*/
|
||||
public $content;
|
||||
|
||||
/**
|
||||
* Attachment constructor.
|
||||
*
|
||||
* @param string $fileName
|
||||
* @param string $contentType
|
||||
* @param string $content
|
||||
*/
|
||||
public function __construct($fileName, $contentType, $content)
|
||||
{
|
||||
$this->fileName = $fileName;
|
||||
$this->contentType = $contentType;
|
||||
$this->content = $content;
|
||||
}
|
||||
}
|
21
tests/Fixtures/Attachment/AttachmentCollection.php
Normal file
21
tests/Fixtures/Attachment/AttachmentCollection.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures\Attachment;
|
||||
|
||||
class AttachmentCollection
|
||||
{
|
||||
/**
|
||||
* @var Attachment[] $attachments
|
||||
*/
|
||||
public $attachments;
|
||||
|
||||
public function __construct(array $attachments = null)
|
||||
{
|
||||
$this->attachments = $attachments;
|
||||
}
|
||||
|
||||
public function hasAttachments()
|
||||
{
|
||||
return $this->attachments !== null && count($this->attachments) > 0;
|
||||
}
|
||||
}
|
106
tests/Fixtures/DummyService.php
Normal file
106
tests/Fixtures/DummyService.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures;
|
||||
|
||||
use BeSimple\SoapBundle\Soap\SoapAttachment;
|
||||
use BeSimple\SoapCommon\AttachmentsHandlerInterface;
|
||||
use BeSimple\SoapCommon\Storage\RequestHandlerAttachmentsStorage;
|
||||
use Fixtures\Attachment\Attachment;
|
||||
use Fixtures\Attachment\AttachmentCollection;
|
||||
use ReflectionClass;
|
||||
|
||||
class DummyService implements AttachmentsHandlerInterface
|
||||
{
|
||||
/** @var RequestHandlerAttachmentsStorage */
|
||||
private $requestHandlerAttachmentsStorage;
|
||||
|
||||
public function addAttachmentStorage(RequestHandlerAttachmentsStorage $requestHandlerAttachmentsStorage)
|
||||
{
|
||||
$this->requestHandlerAttachmentsStorage = $requestHandlerAttachmentsStorage;
|
||||
}
|
||||
|
||||
public function getAttachmentStorage()
|
||||
{
|
||||
return $this->requestHandlerAttachmentsStorage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
return [
|
||||
'DummyServiceResponse' => DummyServiceResponse::class,
|
||||
'DummyServiceResponseWithAttachments' => DummyServiceResponseWithAttachments::class,
|
||||
'DummyServiceRequest' => DummyServiceRequest::class,
|
||||
'DummyServiceRequestWithAttachments' => DummyServiceRequestWithAttachments::class,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @exclude
|
||||
* @return string
|
||||
*/
|
||||
public function getWsdlPath()
|
||||
{
|
||||
$class = new ReflectionClass(static::class);
|
||||
|
||||
return __DIR__.DIRECTORY_SEPARATOR.$class->getShortName().'.wsdl';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEndpoint()
|
||||
{
|
||||
return 'http://my.test/soap/dummyService';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DummyServiceRequest $dummyServiceRequest
|
||||
* @return DummyServiceResponse
|
||||
*/
|
||||
public function dummyServiceMethod(DummyServiceRequest $dummyServiceRequest)
|
||||
{
|
||||
$dummyServiceHandler = new DummyServiceHandler();
|
||||
|
||||
return $dummyServiceHandler->handle($dummyServiceRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DummyServiceRequestWithAttachments $dummyServiceRequestWithAttachments
|
||||
* @return DummyServiceResponseWithAttachments
|
||||
*/
|
||||
public function dummyServiceMethodWithAttachments(DummyServiceRequestWithAttachments $dummyServiceRequestWithAttachments)
|
||||
{
|
||||
if ($dummyServiceRequestWithAttachments->hasAttachments() === true) {
|
||||
$attachmentStorage = $this->getAttachmentStorage();
|
||||
$attachments = [];
|
||||
foreach ($attachmentStorage->getAttachments() as $soapAttachment) {
|
||||
$attachments[] = new Attachment(
|
||||
$soapAttachment->getId(),
|
||||
$soapAttachment->getType(),
|
||||
$soapAttachment->getContent()
|
||||
);
|
||||
}
|
||||
$dummyServiceRequestWithAttachments->attachmentCollection = new AttachmentCollection($attachments);
|
||||
}
|
||||
|
||||
$dummyServiceHandlerWithAttachments = new DummyServiceHandlerWithAttachments();
|
||||
$dummyServiceResponseWithAttachments = $dummyServiceHandlerWithAttachments->handle($dummyServiceRequestWithAttachments);
|
||||
|
||||
if ($dummyServiceResponseWithAttachments->hasAttachments() === true) {
|
||||
$soapAttachments = [];
|
||||
foreach ($dummyServiceResponseWithAttachments->attachmentCollection->attachments as $attachment) {
|
||||
$soapAttachments[] = new SoapAttachment(
|
||||
$attachment->fileName,
|
||||
$attachment->contentType,
|
||||
$attachment->content
|
||||
);
|
||||
}
|
||||
$this->addAttachmentStorage(new RequestHandlerAttachmentsStorage($soapAttachments));
|
||||
}
|
||||
|
||||
return $dummyServiceResponseWithAttachments;
|
||||
}
|
||||
}
|
92
tests/Fixtures/DummyService.wsdl
Normal file
92
tests/Fixtures/DummyService.wsdl
Normal file
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0"?>
|
||||
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://schema.testcase" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schema.testcase">
|
||||
<wsdl:types>
|
||||
<xsd:schema targetNamespace="http://schema.testcase">
|
||||
<xsd:complexType name="SoapHeaderEntity">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="user" type="xsd:string" minOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>User name for authorization</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="SoapHeader" type="tns:SoapHeaderEntity"/>
|
||||
<xsd:complexType name="DummyServiceRequest">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="dummyAttribute" type="xsd:int" minOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="DummyServiceResponse">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="status" type="xsd:boolean" minOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="DummyServiceRequestWithAttachments">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="dummyAttribute" type="xsd:int" minOccurs="1"/>
|
||||
<xsd:element name="includeAttachments" type="xsd:boolean" minOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="DummyServiceResponseWithAttachments">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="status" type="xsd:boolean" minOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<message name="SoapHeader">
|
||||
<part name="SoapHeader" element="tns:SoapHeader"/>
|
||||
</message>
|
||||
<message name="DummyServiceRequest">
|
||||
<part name="request" type="tns:DummyServiceRequest"/>
|
||||
</message>
|
||||
<message name="DummyServiceRequestWithAttachments">
|
||||
<part name="request" type="tns:DummyServiceRequestWithAttachments"/>
|
||||
</message>
|
||||
<message name="DummyServiceResponse">
|
||||
<part name="dummyServiceReturn" type="tns:DummyServiceResponse"/>
|
||||
</message>
|
||||
<message name="DummyServiceResponseWithAttachments">
|
||||
<part name="dummyServiceReturn" type="tns:DummyServiceResponseWithAttachments"/>
|
||||
</message>
|
||||
<wsdl:portType name="DummyServiceSoapPortType">
|
||||
<wsdl:operation name="dummyServiceMethod">
|
||||
<wsdl:input message="tns:DummyServiceRequest"/>
|
||||
<wsdl:output message="tns:DummyServiceResponse"/>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="dummyServiceMethodWithAttachments">
|
||||
<wsdl:input message="tns:DummyServiceRequestWithAttachments"/>
|
||||
<wsdl:output message="tns:DummyServiceResponseWithAttachments"/>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<binding name="DummyServiceSoapBinding" type="tns:DummyServiceSoapPortType">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<wsdl:operation name="dummyServiceMethod">
|
||||
<soap:operation soapAction="DummyService.dummyServiceMethod" style="rpc"/>
|
||||
<wsdl:input>
|
||||
<soap:header use="literal" message="tns:SoapHeader" part="SoapHeader" namespace="http://schema.testcase"/>
|
||||
<soap:body use="literal" part="request" namespace="http://schema.testcase"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" namespace="http://schema.testcase"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="dummyServiceMethodWithAttachments">
|
||||
<soap:operation soapAction="DummyService.dummyServiceMethodWithAttachments" style="rpc"/>
|
||||
<wsdl:input>
|
||||
<soap:header use="literal" message="tns:SoapHeader" part="SoapHeader" namespace="http://schema.testcase"/>
|
||||
<soap:body use="literal" part="request" namespace="http://schema.testcase"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" namespace="http://schema.testcase"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</binding>
|
||||
<wsdl:service name="DummyService">
|
||||
<xsd:documentation>WSDL file for DummyService</xsd:documentation>
|
||||
<port name="DummyServiceSoapPortType" binding="tns:DummyServiceSoapBinding">
|
||||
<soap:address location="http://schema.testcase"/>
|
||||
</port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
18
tests/Fixtures/DummyServiceHandler.php
Normal file
18
tests/Fixtures/DummyServiceHandler.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures;
|
||||
|
||||
class DummyServiceHandler
|
||||
{
|
||||
/**
|
||||
* @param DummyServiceRequest
|
||||
* @return DummyServiceResponse
|
||||
*/
|
||||
public function handle(DummyServiceRequest $request)
|
||||
{
|
||||
$response = new DummyServiceResponse();
|
||||
$response->status = true;
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
30
tests/Fixtures/DummyServiceHandlerWithAttachments.php
Normal file
30
tests/Fixtures/DummyServiceHandlerWithAttachments.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures;
|
||||
|
||||
use Fixtures\Attachment\Attachment;
|
||||
use Fixtures\Attachment\AttachmentCollection;
|
||||
|
||||
class DummyServiceHandlerWithAttachments
|
||||
{
|
||||
/**
|
||||
* @param DummyServiceRequestWithAttachments $request
|
||||
* @return DummyServiceResponseWithAttachments
|
||||
*/
|
||||
public function handle(DummyServiceRequestWithAttachments $request)
|
||||
{
|
||||
$response = new DummyServiceResponseWithAttachments();
|
||||
$response->status = true;
|
||||
if ($request->includeAttachments === true) {
|
||||
if ($request->hasAttachments() === true) {
|
||||
$attachments = [];
|
||||
foreach ($request->attachmentCollection->attachments as $attachment) {
|
||||
$attachments[] = new Attachment($attachment->fileName, $attachment->contentType, $attachment->content);
|
||||
}
|
||||
$response->attachmentCollection = new AttachmentCollection($attachments);
|
||||
}
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
11
tests/Fixtures/DummyServiceRequest.php
Normal file
11
tests/Fixtures/DummyServiceRequest.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures;
|
||||
|
||||
class DummyServiceRequest
|
||||
{
|
||||
/**
|
||||
* @var int $dummyAttribute
|
||||
*/
|
||||
public $dummyAttribute;
|
||||
}
|
28
tests/Fixtures/DummyServiceRequestWithAttachments.php
Normal file
28
tests/Fixtures/DummyServiceRequestWithAttachments.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures;
|
||||
|
||||
use Fixtures\Attachment\AttachmentCollection;
|
||||
|
||||
class DummyServiceRequestWithAttachments
|
||||
{
|
||||
/**
|
||||
* @var int $dummyAttribute
|
||||
*/
|
||||
public $dummyAttribute;
|
||||
|
||||
/**
|
||||
* @var bool $includeAttachments
|
||||
*/
|
||||
public $includeAttachments;
|
||||
|
||||
/**
|
||||
* @var AttachmentCollection $attachmentCollection
|
||||
*/
|
||||
public $attachmentCollection;
|
||||
|
||||
public function hasAttachments()
|
||||
{
|
||||
return $this->attachmentCollection !== null && $this->attachmentCollection->hasAttachments();
|
||||
}
|
||||
}
|
11
tests/Fixtures/DummyServiceResponse.php
Normal file
11
tests/Fixtures/DummyServiceResponse.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures;
|
||||
|
||||
class DummyServiceResponse
|
||||
{
|
||||
/**
|
||||
* @var bool $status
|
||||
*/
|
||||
public $status;
|
||||
}
|
23
tests/Fixtures/DummyServiceResponseWithAttachments.php
Normal file
23
tests/Fixtures/DummyServiceResponseWithAttachments.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures;
|
||||
|
||||
use Fixtures\Attachment\AttachmentCollection;
|
||||
|
||||
class DummyServiceResponseWithAttachments
|
||||
{
|
||||
/**
|
||||
* @var bool $status
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* @var AttachmentCollection $attachmentCollection
|
||||
*/
|
||||
public $attachmentCollection;
|
||||
|
||||
public function hasAttachments()
|
||||
{
|
||||
return $this->attachmentCollection !== null && $this->attachmentCollection->hasAttachments();
|
||||
}
|
||||
}
|
8
tests/Fixtures/GenerateTestRequest.php
Normal file
8
tests/Fixtures/GenerateTestRequest.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures;
|
||||
|
||||
class GenerateTestRequest
|
||||
{
|
||||
public $salutation;
|
||||
}
|
8
tests/Fixtures/GetUKLocationByCounty.php
Normal file
8
tests/Fixtures/GetUKLocationByCounty.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures;
|
||||
|
||||
class GetUKLocationByCounty
|
||||
{
|
||||
public $County;
|
||||
}
|
7
tests/Fixtures/SoapServerHandler.php
Normal file
7
tests/Fixtures/SoapServerHandler.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Fixtures;
|
||||
|
||||
class SoapServerHandler
|
||||
{
|
||||
}
|
380
tests/Fixtures/localWsdl.wsdl
Normal file
380
tests/Fixtures/localWsdl.wsdl
Normal file
@ -0,0 +1,380 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.webserviceX.NET" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://www.webserviceX.NET" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get UK Postcode,Town,County and Validate UK Address</wsdl:documentation>
|
||||
<wsdl:types>
|
||||
<s:schema elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET">
|
||||
<s:element name="GetUKLocationByCounty">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="County" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="GetUKLocationByCountyResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="GetUKLocationByCountyResult" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="GetUKLocationByTown">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Town" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="GetUKLocationByTownResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="GetUKLocationByTownResult" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="GetUKLocationByPostCode">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="PostCode" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="GetUKLocationByPostCodeResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="GetUKLocationByPostCodeResult" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="ValidateUKAddress">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="Town" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="County" type="s:string" />
|
||||
<s:element minOccurs="0" maxOccurs="1" name="PostCode" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="ValidateUKAddressResponse">
|
||||
<s:complexType>
|
||||
<s:sequence>
|
||||
<s:element minOccurs="0" maxOccurs="1" name="ValidateUKAddressResult" type="s:string" />
|
||||
</s:sequence>
|
||||
</s:complexType>
|
||||
</s:element>
|
||||
<s:element name="string" nillable="true" type="s:string" />
|
||||
</s:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="GetUKLocationByCountySoapIn">
|
||||
<wsdl:part name="parameters" element="tns:GetUKLocationByCounty" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByCountySoapOut">
|
||||
<wsdl:part name="parameters" element="tns:GetUKLocationByCountyResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByTownSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:GetUKLocationByTown" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByTownSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:GetUKLocationByTownResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByPostCodeSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:GetUKLocationByPostCode" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByPostCodeSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:GetUKLocationByPostCodeResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ValidateUKAddressSoapIn">
|
||||
<wsdl:part name="parameters" element="tns:ValidateUKAddress" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ValidateUKAddressSoapOut">
|
||||
<wsdl:part name="parameters" element="tns:ValidateUKAddressResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByCountyHttpGetIn">
|
||||
<wsdl:part name="County" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByCountyHttpGetOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByTownHttpGetIn">
|
||||
<wsdl:part name="Town" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByTownHttpGetOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByPostCodeHttpGetIn">
|
||||
<wsdl:part name="PostCode" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByPostCodeHttpGetOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ValidateUKAddressHttpGetIn">
|
||||
<wsdl:part name="Town" type="s:string" />
|
||||
<wsdl:part name="County" type="s:string" />
|
||||
<wsdl:part name="PostCode" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ValidateUKAddressHttpGetOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByCountyHttpPostIn">
|
||||
<wsdl:part name="County" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByCountyHttpPostOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByTownHttpPostIn">
|
||||
<wsdl:part name="Town" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByTownHttpPostOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByPostCodeHttpPostIn">
|
||||
<wsdl:part name="PostCode" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="GetUKLocationByPostCodeHttpPostOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ValidateUKAddressHttpPostIn">
|
||||
<wsdl:part name="Town" type="s:string" />
|
||||
<wsdl:part name="County" type="s:string" />
|
||||
<wsdl:part name="PostCode" type="s:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ValidateUKAddressHttpPostOut">
|
||||
<wsdl:part name="Body" element="tns:string" />
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="UKLocationSoap">
|
||||
<wsdl:operation name="GetUKLocationByCounty">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get UK town,Postcode and County by full /partial County</wsdl:documentation>
|
||||
<wsdl:input message="tns:GetUKLocationByCountySoapIn" />
|
||||
<wsdl:output message="tns:GetUKLocationByCountySoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByTown">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get UK town,Postcode and County by full /partial Town</wsdl:documentation>
|
||||
<wsdl:input message="tns:GetUKLocationByTownSoapIn" />
|
||||
<wsdl:output message="tns:GetUKLocationByTownSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByPostCode">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get UK town,Postcode and County by Postcode(First Section of Post Code)</wsdl:documentation>
|
||||
<wsdl:input message="tns:GetUKLocationByPostCodeSoapIn" />
|
||||
<wsdl:output message="tns:GetUKLocationByPostCodeSoapOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ValidateUKAddress">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Validate UK address,Use First Section of Poscode for Postcode atribute</wsdl:documentation>
|
||||
<wsdl:input message="tns:ValidateUKAddressSoapIn" />
|
||||
<wsdl:output message="tns:ValidateUKAddressSoapOut" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:portType name="UKLocationHttpGet">
|
||||
<wsdl:operation name="GetUKLocationByCounty">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get UK town,Postcode and County by full /partial County</wsdl:documentation>
|
||||
<wsdl:input message="tns:GetUKLocationByCountyHttpGetIn" />
|
||||
<wsdl:output message="tns:GetUKLocationByCountyHttpGetOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByTown">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get UK town,Postcode and County by full /partial Town</wsdl:documentation>
|
||||
<wsdl:input message="tns:GetUKLocationByTownHttpGetIn" />
|
||||
<wsdl:output message="tns:GetUKLocationByTownHttpGetOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByPostCode">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get UK town,Postcode and County by Postcode(First Section of Post Code)</wsdl:documentation>
|
||||
<wsdl:input message="tns:GetUKLocationByPostCodeHttpGetIn" />
|
||||
<wsdl:output message="tns:GetUKLocationByPostCodeHttpGetOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ValidateUKAddress">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Validate UK address,Use First Section of Poscode for Postcode atribute</wsdl:documentation>
|
||||
<wsdl:input message="tns:ValidateUKAddressHttpGetIn" />
|
||||
<wsdl:output message="tns:ValidateUKAddressHttpGetOut" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:portType name="UKLocationHttpPost">
|
||||
<wsdl:operation name="GetUKLocationByCounty">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get UK town,Postcode and County by full /partial County</wsdl:documentation>
|
||||
<wsdl:input message="tns:GetUKLocationByCountyHttpPostIn" />
|
||||
<wsdl:output message="tns:GetUKLocationByCountyHttpPostOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByTown">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get UK town,Postcode and County by full /partial Town</wsdl:documentation>
|
||||
<wsdl:input message="tns:GetUKLocationByTownHttpPostIn" />
|
||||
<wsdl:output message="tns:GetUKLocationByTownHttpPostOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByPostCode">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get UK town,Postcode and County by Postcode(First Section of Post Code)</wsdl:documentation>
|
||||
<wsdl:input message="tns:GetUKLocationByPostCodeHttpPostIn" />
|
||||
<wsdl:output message="tns:GetUKLocationByPostCodeHttpPostOut" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ValidateUKAddress">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Validate UK address,Use First Section of Poscode for Postcode atribute</wsdl:documentation>
|
||||
<wsdl:input message="tns:ValidateUKAddressHttpPostIn" />
|
||||
<wsdl:output message="tns:ValidateUKAddressHttpPostOut" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="UKLocationSoap" type="tns:UKLocationSoap">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="GetUKLocationByCounty">
|
||||
<soap:operation soapAction="http://www.webserviceX.NET/GetUKLocationByCounty" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByTown">
|
||||
<soap:operation soapAction="http://www.webserviceX.NET/GetUKLocationByTown" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByPostCode">
|
||||
<soap:operation soapAction="http://www.webserviceX.NET/GetUKLocationByPostCode" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ValidateUKAddress">
|
||||
<soap:operation soapAction="http://www.webserviceX.NET/ValidateUKAddress" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:binding name="UKLocationSoap12" type="tns:UKLocationSoap">
|
||||
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="GetUKLocationByCounty">
|
||||
<soap12:operation soapAction="http://www.webserviceX.NET/GetUKLocationByCounty" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByTown">
|
||||
<soap12:operation soapAction="http://www.webserviceX.NET/GetUKLocationByTown" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByPostCode">
|
||||
<soap12:operation soapAction="http://www.webserviceX.NET/GetUKLocationByPostCode" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ValidateUKAddress">
|
||||
<soap12:operation soapAction="http://www.webserviceX.NET/ValidateUKAddress" style="document" />
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:binding name="UKLocationHttpGet" type="tns:UKLocationHttpGet">
|
||||
<http:binding verb="GET" />
|
||||
<wsdl:operation name="GetUKLocationByCounty">
|
||||
<http:operation location="/GetUKLocationByCounty" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByTown">
|
||||
<http:operation location="/GetUKLocationByTown" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByPostCode">
|
||||
<http:operation location="/GetUKLocationByPostCode" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ValidateUKAddress">
|
||||
<http:operation location="/ValidateUKAddress" />
|
||||
<wsdl:input>
|
||||
<http:urlEncoded />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:binding name="UKLocationHttpPost" type="tns:UKLocationHttpPost">
|
||||
<http:binding verb="POST" />
|
||||
<wsdl:operation name="GetUKLocationByCounty">
|
||||
<http:operation location="/GetUKLocationByCounty" />
|
||||
<wsdl:input>
|
||||
<mime:content type="application/x-www-form-urlencoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByTown">
|
||||
<http:operation location="/GetUKLocationByTown" />
|
||||
<wsdl:input>
|
||||
<mime:content type="application/x-www-form-urlencoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetUKLocationByPostCode">
|
||||
<http:operation location="/GetUKLocationByPostCode" />
|
||||
<wsdl:input>
|
||||
<mime:content type="application/x-www-form-urlencoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ValidateUKAddress">
|
||||
<http:operation location="/ValidateUKAddress" />
|
||||
<wsdl:input>
|
||||
<mime:content type="application/x-www-form-urlencoded" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:mimeXml part="Body" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="UKLocation">
|
||||
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get UK Postcode,Town,County and Validate UK Address</wsdl:documentation>
|
||||
<wsdl:port name="UKLocationSoap" binding="tns:UKLocationSoap">
|
||||
<soap:address location="http://www.webservicex.net/uklocation.asmx" />
|
||||
</wsdl:port>
|
||||
<wsdl:port name="UKLocationSoap12" binding="tns:UKLocationSoap12">
|
||||
<soap12:address location="http://www.webservicex.net/uklocation.asmx" />
|
||||
</wsdl:port>
|
||||
<wsdl:port name="UKLocationHttpGet" binding="tns:UKLocationHttpGet">
|
||||
<http:address location="http://www.webservicex.net/uklocation.asmx" />
|
||||
</wsdl:port>
|
||||
<wsdl:port name="UKLocationHttpPost" binding="tns:UKLocationHttpPost">
|
||||
<http:address location="http://www.webservicex.net/uklocation.asmx" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
2
tests/Fixtures/soapRequestWithNoAttachments.request
Normal file
2
tests/Fixtures/soapRequestWithNoAttachments.request
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://www.webserviceX.NET"><env:Body><ns1:GetUKLocationByCounty><ns1:County>London</ns1:County></ns1:GetUKLocationByCounty></env:Body></env:Envelope>
|
24
tests/Fixtures/soapRequestWithTwoAttachments.request
Normal file
24
tests/Fixtures/soapRequestWithTwoAttachments.request
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
--Part_10_589b2dcf4f7fb.589b2dcf4f804
|
||||
Content-Type: application/soap+xml; charset=utf-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Content-ID: <part-7e61b8e0-f84d-4cf7-8043-3c27d90767af@response.info>
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://www.webserviceX.NET"><env:Body><ns1:GetUKLocationByCounty><ns1:County>London</ns1:County></ns1:GetUKLocationByCounty></env:Body></env:Envelope>
|
||||
|
||||
--Part_10_589b2dcf4f7fb.589b2dcf4f804
|
||||
Content-Type: application/pdf; charset=utf-8
|
||||
Content-Transfer-Encoding: binary
|
||||
Content-ID: <first-file.txt>
|
||||
Content-Location: first-file.txt
|
||||
|
||||
hello world
|
||||
--Part_10_589b2dcf4f7fb.589b2dcf4f804
|
||||
Content-Type: application/pdf; charset=utf-8
|
||||
Content-Transfer-Encoding: binary
|
||||
Content-ID: <second-file.txt>
|
||||
Content-Location: second-file.txt
|
||||
|
||||
hello world
|
||||
--Part_10_589b2dcf4f7fb.589b2dcf4f804--
|
14
tests/Fixtures/testHandleRequest.message
Normal file
14
tests/Fixtures/testHandleRequest.message
Normal file
@ -0,0 +1,14 @@
|
||||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://schema.testcase">
|
||||
<soapenv:Header>
|
||||
<sch:SoapHeader>
|
||||
<user>admin</user>
|
||||
</sch:SoapHeader>
|
||||
</soapenv:Header>
|
||||
<soapenv:Body>
|
||||
<sch:dummyServiceMethod>
|
||||
<request>
|
||||
<dummyAttribute>1</dummyAttribute>
|
||||
</request>
|
||||
</sch:dummyServiceMethod>
|
||||
</soapenv:Body>
|
||||
</soapenv:Envelope>
|
15
tests/Fixtures/testHandleRequestWithSwa.message
Normal file
15
tests/Fixtures/testHandleRequestWithSwa.message
Normal file
@ -0,0 +1,15 @@
|
||||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://schema.testcase">
|
||||
<soapenv:Header>
|
||||
<sch:SoapHeader>
|
||||
<user>admin</user>
|
||||
</sch:SoapHeader>
|
||||
</soapenv:Header>
|
||||
<soapenv:Body>
|
||||
<sch:dummyServiceMethodWithAttachments>
|
||||
<request>
|
||||
<dummyAttribute>2</dummyAttribute>
|
||||
<includeAttachments>false</includeAttachments>
|
||||
</request>
|
||||
</sch:dummyServiceMethodWithAttachments>
|
||||
</soapenv:Body>
|
||||
</soapenv:Envelope>
|
62
tests/Fixtures/testHandleRequestWithSwa.mimepart.message
Normal file
62
tests/Fixtures/testHandleRequestWithSwa.mimepart.message
Normal file
@ -0,0 +1,62 @@
|
||||
|
||||
------=_Part_6_2094841787.1482231370463
|
||||
Content-Type: text/xml; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Content-ID: <rootpart@soapui.org>
|
||||
|
||||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://schema.testcase">
|
||||
<soapenv:Header>
|
||||
<sch:SoapHeader>
|
||||
<user>admin</user>
|
||||
</sch:SoapHeader>
|
||||
</soapenv:Header>
|
||||
<soapenv:Body>
|
||||
<sch:dummyServiceMethodWithAttachments>
|
||||
<request>
|
||||
<dummyAttribute>3</dummyAttribute>
|
||||
<includeAttachments>true</includeAttachments>
|
||||
</request>
|
||||
</sch:dummyServiceMethodWithAttachments>
|
||||
</soapenv:Body>
|
||||
</soapenv:Envelope>
|
||||
------=_Part_6_2094841787.1482231370463
|
||||
Content-Type: text/html; charset=us-ascii; name=test-page.html
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Content-ID: <test-page.html>
|
||||
Content-Disposition: attachment; name="test-page.html"; filename="test-page.html"
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>Test file page</title>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
h1 {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 11pt;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Hello World!</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
------=_Part_6_2094841787.1482231370463
|
||||
Content-Type: application/x-sh; name=testscript.sh
|
||||
Content-Transfer-Encoding: binary
|
||||
Content-ID: <testscript.sh>
|
||||
Content-Disposition: attachment; name="testscript.sh"; filename="testscript.sh"
|
||||
|
||||
#!/bin/sh
|
||||
### ====================================================================== ###
|
||||
## ##
|
||||
## Test Script ##
|
||||
## ##
|
||||
### ====================================================================== ###
|
||||
|
||||
------=_Part_6_2094841787.1482231370463--
|
Reference in New Issue
Block a user