Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
ab83642f06 | |||
564005da93 | |||
311f9e6d08 | |||
e67d5aa84b | |||
d3023b1a5a | |||
21d705bbfa | |||
0e2c33faf8 | |||
cf6e147c26 | |||
f276a30a47 | |||
4edc46e67f | |||
a76526a5b6 | |||
baf32c1350 | |||
5c0bf914e3 | |||
01d10b89fd |
65
README.md
65
README.md
@ -1,8 +1,8 @@
|
||||
# BeSimpleSoap
|
||||
|
||||
Build SOAP and WSDL based web services.
|
||||
This fork from 2017 is a refactored version that fixes a lot of errors and provides
|
||||
better APi, more robust, stable and modern codebase.
|
||||
This fork is a refactored version that fixes a lot of errors and provides
|
||||
better API, robust, stable and modern codebase.
|
||||
See [How to use](#how-to-use) that will help you to understand the magic.
|
||||
|
||||
# Components
|
||||
@ -23,14 +23,16 @@ BeSimpleSoap consists of five components ...
|
||||
|
||||
## BeSimpleSoapWsdl
|
||||
|
||||
Currently **unsupported!** For further information see the [README](https://github.com/BeSimple/BeSimpleSoap/blob/master/src/BeSimple/SoapWsdl/README.md).
|
||||
**Untouched!**
|
||||
The component is not affected by refactoring so it should work properly.
|
||||
For further information see the original [README](https://github.com/BeSimple/BeSimpleSoap/blob/master/src/BeSimple/SoapWsdl/README.md).
|
||||
|
||||
## BeSimpleSoapBundle
|
||||
|
||||
Currently **unsupported!**
|
||||
**Unsupported!**
|
||||
The BeSimpleSoapBundle is a Symfony2 bundle to build WSDL and SOAP based web services.
|
||||
For further information see the the original [README](https://github.com/BeSimple/BeSimpleSoap/blob/master/src/BeSimple/SoapBundle/README.md).
|
||||
*May not work properly since the Symfony libraries were removed.*
|
||||
*Will not work since the Symfony libraries were removed and usages of other components were not refactored. Feel free to fork this repository and fix it!*
|
||||
|
||||
# Installation
|
||||
|
||||
@ -58,17 +60,12 @@ php /usr/local/bin/composer.phar install
|
||||
|
||||
# How to use
|
||||
|
||||
You can investigate the unit tests in order to get a clue.
|
||||
Forget about associative arrays, multiple extension and silent errors!
|
||||
You can investigate the unit tests dir ``tests`` in order to get a clue.
|
||||
Forget about associative arrays, vague configurations, multiple extension and silent errors!
|
||||
This may look a bit more complex at the first sight,
|
||||
but it will guide you to configure and set up your client or server properly.
|
||||
|
||||
```
|
||||
// unit tests for soap client
|
||||
BeSimple\SoapClient\Tests\SoapClientBuilderTest
|
||||
// unit tests for soap server
|
||||
BeSimple\SoapServer\Tests\SoapServerBuilderTest
|
||||
```
|
||||
|
||||
## Small example of soap client call
|
||||
## Example of soap client call
|
||||
|
||||
```php
|
||||
$soapClientBuilder = new SoapClientBuilder();
|
||||
@ -88,18 +85,18 @@ Turn on the tracking and catch `SoapFaultWithTracingData` exception to get some
|
||||
|
||||
```php
|
||||
try {
|
||||
$soapResponse = $soapClient->soapCall('GetUKLocationByCounty', [$getUKLocationByCountyRequest]);
|
||||
$soapResponse = $soapClient->soapCall('myMethod', [$myRequest]);
|
||||
} catch (SoapFaultWithTracingData $fault) {
|
||||
var_dump($fault->getSoapResponseTracingData()->getLastRequest());
|
||||
}
|
||||
```
|
||||
In this example, a ``MyRequest`` object has been used to describe request.
|
||||
Using a ClassMap, you help SoapClient to turn it into XML request.
|
||||
|
||||
## Small example of soap server handling
|
||||
## Example of soap server handling
|
||||
|
||||
Starting a SOAP server is a bit more complex.
|
||||
I would suggest you to inspect SoapServer unit tests to get complete image.
|
||||
But don't be scared too much, you just need to create a DummyService that will
|
||||
handle your client SOAP calls.
|
||||
I recommend you to inspect SoapServer unit tests for inspiration.
|
||||
|
||||
```php
|
||||
$dummyService = new DummyService();
|
||||
@ -116,9 +113,35 @@ $request = $soapServer->createRequest(
|
||||
$dummyService->getEndpoint(),
|
||||
'DummyService.dummyServiceMethod',
|
||||
'text/xml;charset=UTF-8',
|
||||
'<your><soap><request><here /></request></soap></your>'
|
||||
'<received><soap><request><here /></request></soap></received>'
|
||||
);
|
||||
$response = $soapServer->handleRequest($request);
|
||||
|
||||
var_dump($response); // Contains Response, Attachments
|
||||
```
|
||||
In this example, a ``DummyService`` service has been used to handle request.
|
||||
Using a service can help you create coherent SoapServer endpoints.
|
||||
Service can hold an endpoint URL, WSDL path and a class map as associative array.
|
||||
You can hold a class map as ``ClassMap`` object directly in the ``DummyService`` instead of array.
|
||||
|
||||
In the service you should describe SOAP methods from given WSDL.
|
||||
In the example, the dummyServiceMethod is called.
|
||||
The method will receive request object and return response object that are matched according to the class map.
|
||||
|
||||
See a simplified implementation of ``dummyServiceMethod`` to get a clue:
|
||||
|
||||
```
|
||||
/**
|
||||
* @param DummyServiceRequest $dummyServiceRequest
|
||||
* @return DummyServiceResponse
|
||||
*/
|
||||
public function dummyServiceMethod(DummyServiceRequest $dummyServiceRequest)
|
||||
{
|
||||
$response = new DummyServiceResponse();
|
||||
$response->status = true;
|
||||
|
||||
return $response;
|
||||
}
|
||||
```
|
||||
|
||||
For further information and getting inspiration for your implementation, see the unit tests in ``tests`` dir.
|
@ -44,6 +44,11 @@
|
||||
"autoload": {
|
||||
"psr-0": { "BeSimple\\": "src/" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"": "tests/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "0.4-dev"
|
||||
|
@ -10,17 +10,14 @@
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="false"
|
||||
stderr="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
>
|
||||
|
||||
bootstrap="vendor/autoload.php">
|
||||
<php>
|
||||
<const name="WEBSERVER_PORT" value="8000" />
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="BeSimpleSoap Test Suite">
|
||||
<file>src/BeSimple/SoapClient/Tests/SoapClientBuilderTest.php</file>
|
||||
<file>src/BeSimple/SoapServer/Tests/SoapServerBuilderTest.php</file>
|
||||
<testsuite name="BeSimpleSoapTestSuite">
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
||||
|
@ -62,7 +62,7 @@ class Curl
|
||||
curl_setopt_array($curlSession, [
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_SSL_VERIFYPEER => false,
|
||||
CURLOPT_FAILONERROR => true,
|
||||
CURLOPT_FAILONERROR => false,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_HEADER => true,
|
||||
@ -147,6 +147,8 @@ class Curl
|
||||
$headerSize = curl_getinfo($curlSession, CURLINFO_HEADER_SIZE);
|
||||
$httpResponseCode = curl_getinfo($curlSession, CURLINFO_HTTP_CODE);
|
||||
$httpResponseContentType = curl_getinfo($curlSession, CURLINFO_CONTENT_TYPE);;
|
||||
$responseBody = substr($executeSoapCallResponse, $headerSize);
|
||||
$responseHeaders = substr($executeSoapCallResponse, 0, $headerSize);
|
||||
preg_match('/HTTP\/(1\.[0-1]+) ([0-9]{3}) (.*)/', $executeSoapCallResponse, $httpResponseMessages);
|
||||
$httpResponseMessage = trim(array_pop($httpResponseMessages));
|
||||
$curlErrorMessage = sprintf(
|
||||
@ -156,7 +158,7 @@ class Curl
|
||||
$location
|
||||
);
|
||||
|
||||
if ($executeSoapCallResponse === false) {
|
||||
if (!is_integer($httpResponseCode) || $httpResponseCode >= 400 || $httpResponseCode === 0) {
|
||||
|
||||
return new CurlResponse(
|
||||
$httpRequestHeadersAsString,
|
||||
@ -164,6 +166,8 @@ class Curl
|
||||
$httpResponseMessage,
|
||||
$httpResponseContentType,
|
||||
self::CURL_FAILED,
|
||||
$responseHeaders,
|
||||
$responseBody,
|
||||
$curlErrorMessage
|
||||
);
|
||||
}
|
||||
@ -174,9 +178,8 @@ class Curl
|
||||
$httpResponseMessage,
|
||||
$httpResponseContentType,
|
||||
self::CURL_SUCCESS,
|
||||
null,
|
||||
substr($executeSoapCallResponse, 0, $headerSize),
|
||||
substr($executeSoapCallResponse, $headerSize)
|
||||
$responseHeaders,
|
||||
$responseBody
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ use BeSimple\SoapClient\SoapServerProxy\SoapServerProxy;
|
||||
|
||||
class CurlOptions
|
||||
{
|
||||
const DEFAULT_USER_AGENT = 'BeSimpleSoap';
|
||||
const DEFAULT_USER_AGENT = 'PhpBeSimpleSoap';
|
||||
const SOAP_COMPRESSION_NONE = null;
|
||||
const SOAP_COMPRESSION_GZIP = SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP;
|
||||
const SOAP_COMPRESSION_DEFLATE = SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_DEFLATE;
|
||||
|
@ -13,7 +13,7 @@ use Exception;
|
||||
class CurlOptionsBuilder
|
||||
{
|
||||
const DEFAULT_MAX_REDIRECTS = 10;
|
||||
const DEFAULT_CONNECTION_TIMEOUT = 10;
|
||||
const DEFAULT_CONNECTION_TIMEOUT = 120;
|
||||
|
||||
public static function buildDefault()
|
||||
{
|
||||
|
@ -19,9 +19,9 @@ class CurlResponse
|
||||
$httpResponseStatusMessage,
|
||||
$httpResponseContentType,
|
||||
$curlStatus,
|
||||
$curlErrorMessage = null,
|
||||
$responseHeader = null,
|
||||
$responseBody = null
|
||||
$responseHeader,
|
||||
$responseBody,
|
||||
$curlErrorMessage = null
|
||||
) {
|
||||
$this->httpRequestHeaders = $httpRequestHeaders;
|
||||
$this->httpResponseStatusCode = $httpResponseStatusCode;
|
||||
@ -78,21 +78,11 @@ class CurlResponse
|
||||
return $this->curlErrorMessage;
|
||||
}
|
||||
|
||||
public function hasResponseHeader()
|
||||
{
|
||||
return $this->responseHeader !== null;
|
||||
}
|
||||
|
||||
public function getResponseHeader()
|
||||
{
|
||||
return $this->responseHeader;
|
||||
}
|
||||
|
||||
public function hasResponseBody()
|
||||
{
|
||||
return $this->responseBody !== null;
|
||||
}
|
||||
|
||||
public function getResponseBody()
|
||||
{
|
||||
return $this->responseBody;
|
||||
|
@ -37,12 +37,12 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter
|
||||
$soapPart = new MimePart($request->getContent(), 'text/xml', 'utf-8', MimePart::ENCODING_EIGHT_BIT);
|
||||
$soapVersion = $request->getVersion();
|
||||
|
||||
if ($soapVersion == SOAP_1_1 && $attachmentType & Helper::ATTACHMENTS_TYPE_MTOM) {
|
||||
if ($soapVersion === SOAP_1_1 && $attachmentType & Helper::ATTACHMENTS_TYPE_MTOM) {
|
||||
$multipart->setHeader('Content-Type', 'type', 'application/xop+xml');
|
||||
$multipart->setHeader('Content-Type', 'start-info', 'text/xml');
|
||||
$soapPart->setHeader('Content-Type', 'application/xop+xml');
|
||||
$soapPart->setHeader('Content-Type', 'type', 'text/xml');
|
||||
} elseif ($soapVersion == SOAP_1_2) {
|
||||
} elseif ($soapVersion === SOAP_1_2) {
|
||||
$multipart->setHeader('Content-Type', 'type', 'application/soap+xml');
|
||||
$soapPart->setHeader('Content-Type', 'application/soap+xml');
|
||||
}
|
||||
@ -71,7 +71,7 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter
|
||||
$soapPart = $multiPartMessage->getMainPart();
|
||||
$attachments = $multiPartMessage->getAttachments();
|
||||
|
||||
$response->setContent($this->sanitizePhpExceptionOnHrefs($soapPart));
|
||||
$response->setContent($soapPart->getContent());
|
||||
$response->setContentType($soapPart->getHeader('Content-Type'));
|
||||
if (count($attachments) > 0) {
|
||||
$response->setAttachments($attachments);
|
||||
|
@ -19,6 +19,8 @@ use BeSimple\SoapClient\Curl\CurlOptionsBuilder;
|
||||
use BeSimple\SoapClient\Curl\CurlResponse;
|
||||
use BeSimple\SoapClient\SoapOptions\SoapClientOptions;
|
||||
use BeSimple\SoapCommon\Fault\SoapFaultEnum;
|
||||
use BeSimple\SoapCommon\Fault\SoapFaultPrefixEnum;
|
||||
use BeSimple\SoapCommon\Fault\SoapFaultSourceGetter;
|
||||
use BeSimple\SoapCommon\Mime\PartFactory;
|
||||
use BeSimple\SoapCommon\SoapKernel;
|
||||
use BeSimple\SoapCommon\SoapOptions\SoapOptions;
|
||||
@ -38,9 +40,16 @@ use SoapFault;
|
||||
*/
|
||||
class SoapClient extends \SoapClient
|
||||
{
|
||||
/** @var SoapClientOptions */
|
||||
protected $soapClientOptions;
|
||||
/** @var SoapOptions */
|
||||
protected $soapOptions;
|
||||
/** @var Curl */
|
||||
private $curl;
|
||||
/** @var SoapAttachment[] */
|
||||
private $soapAttachmentsOnRequestStorage;
|
||||
/** @var SoapResponse */
|
||||
private $soapResponseStorage;
|
||||
|
||||
public function __construct(SoapClientOptions $soapClientOptions, SoapOptions $soapOptions)
|
||||
{
|
||||
@ -54,7 +63,8 @@ class SoapClient extends \SoapClient
|
||||
$wsdlPath = $this->loadWsdl(
|
||||
$this->curl,
|
||||
$soapOptions->getWsdlFile(),
|
||||
$soapOptions->getWsdlCacheType()
|
||||
$soapOptions->getWsdlCacheType(),
|
||||
false
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
throw new SoapFault(
|
||||
@ -88,9 +98,9 @@ class SoapClient extends \SoapClient
|
||||
* @param array|null $output_headers
|
||||
* @return string
|
||||
*/
|
||||
public function __soapCall($function_name, array $arguments, array $options = null, $input_headers = null, array &$output_headers = null)
|
||||
public function __soapCall($function_name, $arguments, $options = null, $input_headers = null, &$output_headers = null)
|
||||
{
|
||||
return $this->soapCall($function_name, $arguments, $options, $input_headers, $output_headers)->getContent();
|
||||
return $this->soapCall($function_name, $arguments, $options, $input_headers, $output_headers)->getResponseContent();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -104,17 +114,39 @@ class SoapClient extends \SoapClient
|
||||
*/
|
||||
public function soapCall($functionName, array $arguments, array $soapAttachments = [], array $options = null, $inputHeaders = null, array &$outputHeaders = null)
|
||||
{
|
||||
ob_start();
|
||||
parent::__soapCall($functionName, $arguments, $options, $inputHeaders, $outputHeaders);
|
||||
$nativeSoapClientRequest = $this->mapNativeDataJsonToDto(ob_get_clean());
|
||||
$this->setSoapAttachmentsOnRequestToStorage($soapAttachments);
|
||||
try {
|
||||
|
||||
return $this->performSoapRequest(
|
||||
$nativeSoapClientRequest->request,
|
||||
$nativeSoapClientRequest->location,
|
||||
$nativeSoapClientRequest->action,
|
||||
$nativeSoapClientRequest->version,
|
||||
$soapAttachments
|
||||
);
|
||||
$soapResponseAsObject = parent::__soapCall($functionName, $arguments, $options, $inputHeaders, $outputHeaders);
|
||||
$soapResponse = $this->getSoapResponseFromStorage();
|
||||
$soapResponse->setResponseObject($soapResponseAsObject);
|
||||
|
||||
return $soapResponse;
|
||||
|
||||
} catch (SoapFault $soapFault) {
|
||||
if (SoapFaultSourceGetter::isNativeSoapFault($soapFault)) {
|
||||
$soapResponse = $this->getSoapResponseFromStorage();
|
||||
if ($soapResponse instanceof SoapResponse) {
|
||||
$soapFault = $this->throwSoapFaultByTracing(
|
||||
SoapFaultPrefixEnum::PREFIX_PHP . '-' . $soapFault->getCode(),
|
||||
$soapFault->getMessage(),
|
||||
new SoapResponseTracingData(
|
||||
'Content-Type: ' . $soapResponse->getRequest()->getContentType(),
|
||||
$soapResponse->getRequest()->getContent(),
|
||||
'Content-Type: ' . $soapResponse->getContentType(),
|
||||
$soapResponse->getResponseContent()
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$soapFault = new SoapFault(
|
||||
SoapFaultPrefixEnum::PREFIX_PHP . '-unresolved',
|
||||
'Got SoapFault message with no response: '.$soapFault->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
throw $soapFault;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -130,34 +162,16 @@ class SoapClient extends \SoapClient
|
||||
*/
|
||||
public function __doRequest($request, $location, $action, $version, $oneWay = 0)
|
||||
{
|
||||
$soapClientNativeDataTransferObject = new SoapClientNativeDataTransferObject(
|
||||
$soapResponse = $this->performSoapRequest(
|
||||
$request,
|
||||
$location,
|
||||
$action,
|
||||
$version
|
||||
$version,
|
||||
$this->getSoapAttachmentsOnRequestFromStorage()
|
||||
);
|
||||
echo json_encode($soapClientNativeDataTransferObject);
|
||||
$this->setSoapResponseToStorage($soapResponse);
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom request method to be able to modify the SOAP messages.
|
||||
* $oneWay parameter is not used at the moment.
|
||||
*
|
||||
* @param mixed $request Request object
|
||||
* @param string $location Location
|
||||
* @param string $action SOAP action
|
||||
* @param int $version SOAP version
|
||||
* @param SoapAttachment[] $soapAttachments SOAP attachments array
|
||||
*
|
||||
* @return SoapResponse
|
||||
*/
|
||||
public function performSoapRequest($request, $location, $action, $version, array $soapAttachments = [])
|
||||
{
|
||||
$soapRequest = $this->createSoapRequest($location, $action, $version, $request, $soapAttachments);
|
||||
|
||||
return $this->performHttpSoapRequest($soapRequest);
|
||||
return $soapResponse->getResponseContent();
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
@ -200,6 +214,25 @@ class SoapClient extends \SoapClient
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom request method to be able to modify the SOAP messages.
|
||||
* $oneWay parameter is not used at the moment.
|
||||
*
|
||||
* @param mixed $request Request object
|
||||
* @param string $location Location
|
||||
* @param string $action SOAP action
|
||||
* @param int $version SOAP version
|
||||
* @param SoapAttachment[] $soapAttachments SOAP attachments array
|
||||
*
|
||||
* @return SoapResponse
|
||||
*/
|
||||
private function performSoapRequest($request, $location, $action, $version, array $soapAttachments = [])
|
||||
{
|
||||
$soapRequest = $this->createSoapRequest($location, $action, $version, $request, $soapAttachments);
|
||||
|
||||
return $this->performHttpSoapRequest($soapRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $location Location
|
||||
* @param string $action SOAP action
|
||||
@ -242,12 +275,14 @@ class SoapClient extends \SoapClient
|
||||
{
|
||||
if ($soapRequest->getVersion() === SOAP_1_1) {
|
||||
$headers = [
|
||||
'Content-Type:' . $soapRequest->getContentType(),
|
||||
'Content-Type: ' . $soapRequest->getContentType(),
|
||||
'SOAPAction: "' . $soapRequest->getAction() . '"',
|
||||
'Connection: ' . ($this->soapOptions->isConnectionKeepAlive() ? 'Keep-Alive' : 'close'),
|
||||
];
|
||||
} else {
|
||||
$headers = [
|
||||
'Content-Type:' . $soapRequest->getContentType() . '; action="' . $soapRequest->getAction() . '"',
|
||||
'Content-Type: ' . $soapRequest->getContentType() . '; action="' . $soapRequest->getAction() . '"',
|
||||
'Connection: ' . ($this->soapOptions->isConnectionKeepAlive() ? 'Keep-Alive' : 'close'),
|
||||
];
|
||||
}
|
||||
$curlResponse = $this->curl->executeCurlWithCachedSession(
|
||||
@ -264,7 +299,6 @@ class SoapClient extends \SoapClient
|
||||
|
||||
if ($curlResponse->curlStatusSuccess()) {
|
||||
$soapResponse = $this->returnSoapResponseByTracing(
|
||||
$this->soapClientOptions->getTrace(),
|
||||
$soapRequest,
|
||||
$curlResponse,
|
||||
$soapResponseTracingData
|
||||
@ -284,16 +318,14 @@ class SoapClient extends \SoapClient
|
||||
} else if ($curlResponse->curlStatusFailed()) {
|
||||
|
||||
return $this->throwSoapFaultByTracing(
|
||||
$this->soapClientOptions->getTrace(),
|
||||
SoapFaultEnum::SOAP_FAULT_HTTP.'-'.$curlResponse->getHttpResponseStatusCode(),
|
||||
SoapFaultPrefixEnum::PREFIX_DEFAULT.'-'.SoapFaultEnum::SOAP_FAULT_HTTP.'-'.$curlResponse->getHttpResponseStatusCode(),
|
||||
$curlResponse->getCurlErrorMessage(),
|
||||
$soapResponseTracingData
|
||||
);
|
||||
} else {
|
||||
|
||||
return $this->throwSoapFaultByTracing(
|
||||
$this->soapClientOptions->getTrace(),
|
||||
SoapFaultEnum::SOAP_FAULT_SOAP_CLIENT_ERROR,
|
||||
SoapFaultPrefixEnum::PREFIX_DEFAULT.'-'.SoapFaultEnum::SOAP_FAULT_SOAP_CLIENT_ERROR,
|
||||
'Cannot process curl response with unresolved status: ' . $curlResponse->getCurlStatus(),
|
||||
$soapResponseTracingData
|
||||
);
|
||||
@ -336,32 +368,17 @@ class SoapClient extends \SoapClient
|
||||
return $filters;
|
||||
}
|
||||
|
||||
private function mapNativeDataJsonToDto($nativeDataJson)
|
||||
{
|
||||
$nativeData = json_decode($nativeDataJson);
|
||||
|
||||
return new SoapClientNativeDataTransferObject(
|
||||
$nativeData->request,
|
||||
$nativeData->location,
|
||||
$nativeData->action,
|
||||
$nativeData->version
|
||||
);
|
||||
}
|
||||
|
||||
private function returnSoapResponseByTracing(
|
||||
$isTracingEnabled,
|
||||
SoapRequest $soapRequest,
|
||||
CurlResponse $curlResponse,
|
||||
SoapResponseTracingData $soapResponseTracingData,
|
||||
array $soapAttachments = []
|
||||
) {
|
||||
if ($isTracingEnabled === true) {
|
||||
if ($this->soapClientOptions->getTrace() === true) {
|
||||
|
||||
return SoapResponseFactory::createWithTracingData(
|
||||
$soapRequest,
|
||||
$curlResponse->getResponseBody(),
|
||||
$soapRequest->getLocation(),
|
||||
$soapRequest->getAction(),
|
||||
$soapRequest->getVersion(),
|
||||
$curlResponse->getHttpResponseContentType(),
|
||||
$soapResponseTracingData,
|
||||
$soapAttachments
|
||||
@ -380,9 +397,15 @@ class SoapClient extends \SoapClient
|
||||
}
|
||||
}
|
||||
|
||||
private function throwSoapFaultByTracing($isTracingEnabled, $soapFaultCode, $soapFaultMessage, SoapResponseTracingData $soapResponseTracingData)
|
||||
/**
|
||||
* @param string $soapFaultCode
|
||||
* @param string $soapFaultMessage
|
||||
* @param SoapResponseTracingData $soapResponseTracingData
|
||||
* @throws SoapFault
|
||||
*/
|
||||
private function throwSoapFaultByTracing($soapFaultCode, $soapFaultMessage, SoapResponseTracingData $soapResponseTracingData)
|
||||
{
|
||||
if ($isTracingEnabled === true) {
|
||||
if ($this->soapClientOptions->getTrace() === true) {
|
||||
|
||||
throw new SoapFaultWithTracingData(
|
||||
$soapFaultCode,
|
||||
@ -405,4 +428,33 @@ class SoapClient extends \SoapClient
|
||||
throw new Exception('SoapClientOptions tracing disabled, turn on trace attribute');
|
||||
}
|
||||
}
|
||||
|
||||
private function setSoapResponseToStorage(SoapResponse $soapResponseStorage)
|
||||
{
|
||||
$this->soapResponseStorage = $soapResponseStorage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SoapAttachment[] $soapAttachments
|
||||
*/
|
||||
private function setSoapAttachmentsOnRequestToStorage(array $soapAttachments)
|
||||
{
|
||||
$this->soapAttachmentsOnRequestStorage = $soapAttachments;
|
||||
}
|
||||
|
||||
private function getSoapAttachmentsOnRequestFromStorage()
|
||||
{
|
||||
$soapAttachmentsOnRequest = $this->soapAttachmentsOnRequestStorage;
|
||||
$this->soapAttachmentsOnRequestStorage = null;
|
||||
|
||||
return $soapAttachmentsOnRequest;
|
||||
}
|
||||
|
||||
private function getSoapResponseFromStorage()
|
||||
{
|
||||
$soapResponse = $this->soapResponseStorage;
|
||||
$this->soapResponseStorage = null;
|
||||
|
||||
return $soapResponse;
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient;
|
||||
|
||||
class SoapClientNativeDataTransferObject
|
||||
{
|
||||
public $request;
|
||||
public $location;
|
||||
public $action;
|
||||
public $version;
|
||||
|
||||
public function __construct($request, $location, $action, $version)
|
||||
{
|
||||
$this->request = $request;
|
||||
$this->location = $location;
|
||||
$this->action = $action;
|
||||
$this->version = $version;
|
||||
}
|
||||
}
|
@ -45,6 +45,19 @@ class SoapClientOptionsBuilder
|
||||
);
|
||||
}
|
||||
|
||||
public static function createWithEndpointLocation($endpointLocation)
|
||||
{
|
||||
return new SoapClientOptions(
|
||||
SoapClientOptions::SOAP_CLIENT_TRACE_ON,
|
||||
SoapClientOptions::SOAP_CLIENT_EXCEPTIONS_ON,
|
||||
CurlOptions::DEFAULT_USER_AGENT,
|
||||
SoapClientOptions::SOAP_CLIENT_COMPRESSION_NONE,
|
||||
SoapClientOptions::SOAP_CLIENT_AUTHENTICATION_NONE,
|
||||
SoapClientOptions::SOAP_CLIENT_PROXY_NONE,
|
||||
$endpointLocation
|
||||
);
|
||||
}
|
||||
|
||||
public static function createWithAuthentication(SoapServerAuthenticationInterface $authentication)
|
||||
{
|
||||
return new SoapClientOptions(
|
||||
@ -55,4 +68,17 @@ class SoapClientOptionsBuilder
|
||||
$authentication
|
||||
);
|
||||
}
|
||||
|
||||
public static function createWithAuthenticationAndEndpointLocation($endpointLocation, SoapServerAuthenticationInterface $authentication)
|
||||
{
|
||||
return new SoapClientOptions(
|
||||
SoapClientOptions::SOAP_CLIENT_TRACE_ON,
|
||||
SoapClientOptions::SOAP_CLIENT_EXCEPTIONS_ON,
|
||||
CurlOptions::DEFAULT_USER_AGENT,
|
||||
SoapClientOptions::SOAP_CLIENT_COMPRESSION_NONE,
|
||||
$authentication,
|
||||
SoapClientOptions::SOAP_CLIENT_PROXY_NONE,
|
||||
$endpointLocation
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ class SoapClientOptions
|
||||
const SOAP_CLIENT_COMPRESSION_NONE = CurlOptions::SOAP_COMPRESSION_NONE;
|
||||
const SOAP_CLIENT_COMPRESSION_GZIP = CurlOptions::SOAP_COMPRESSION_GZIP;
|
||||
const SOAP_CLIENT_COMPRESSION_DEFLATE = CurlOptions::SOAP_COMPRESSION_DEFLATE;
|
||||
const SOAP_CLIENT_AUTHENTICATION_NONE = null;
|
||||
const SOAP_CLIENT_PROXY_NONE = null;
|
||||
|
||||
private $trace;
|
||||
private $exceptions;
|
||||
@ -24,23 +26,33 @@ class SoapClientOptions
|
||||
private $compression;
|
||||
private $authentication;
|
||||
private $proxy;
|
||||
private $location;
|
||||
|
||||
/**
|
||||
* @param bool $trace = SoapClientOptions::SOAP_CLIENT_TRACE_ON|SoapClientOptions::SOAP_CLIENT_TRACE_OFF
|
||||
* @param bool $exceptions = SoapClientOptions::SOAP_CLIENT_EXCEPTIONS_ON|SoapClientOptions::SOAP_CLIENT_EXCEPTIONS_OFF
|
||||
* @param string $userAgent
|
||||
* @param int $compression = SoapClientOptions::SOAP_CLIENT_COMPRESSION_NONE|SoapClientOptions::SOAP_CLIENT_COMPRESSION_GZIP|SoapClientOptions::SOAP_CLIENT_COMPRESSION_DEFLATE
|
||||
* @param SoapServerAuthenticationInterface $authentication = null
|
||||
* @param SoapServerProxy $proxy = null
|
||||
* @param int|null $compression = SoapClientOptions::SOAP_CLIENT_COMPRESSION_NONE|SoapClientOptions::SOAP_CLIENT_COMPRESSION_GZIP|SoapClientOptions::SOAP_CLIENT_COMPRESSION_DEFLATE
|
||||
* @param SoapServerAuthenticationInterface|null $authentication
|
||||
* @param SoapServerProxy|null $proxy
|
||||
* @param string|null $location
|
||||
*/
|
||||
public function __construct($trace, $exceptions, $userAgent, $compression = null, SoapServerAuthenticationInterface $authentication = null, SoapServerProxy $proxy = null)
|
||||
{
|
||||
public function __construct(
|
||||
$trace,
|
||||
$exceptions,
|
||||
$userAgent,
|
||||
$compression = null,
|
||||
SoapServerAuthenticationInterface $authentication = null,
|
||||
SoapServerProxy $proxy = null,
|
||||
$location = null
|
||||
) {
|
||||
$this->trace = $trace;
|
||||
$this->exceptions = $exceptions;
|
||||
$this->userAgent = $userAgent;
|
||||
$this->compression = $compression;
|
||||
$this->authentication = $authentication;
|
||||
$this->proxy = $proxy;
|
||||
$this->location = $location;
|
||||
}
|
||||
|
||||
public function getTrace()
|
||||
@ -88,6 +100,11 @@ class SoapClientOptions
|
||||
return $this->proxy !== null;
|
||||
}
|
||||
|
||||
public function hasLocation()
|
||||
{
|
||||
return $this->location !== null;
|
||||
}
|
||||
|
||||
public function getAuthentication()
|
||||
{
|
||||
return $this->authentication;
|
||||
@ -98,6 +115,11 @@ class SoapClientOptions
|
||||
return $this->proxy;
|
||||
}
|
||||
|
||||
public function getLocation()
|
||||
{
|
||||
return $this->location;
|
||||
}
|
||||
|
||||
public function toArray()
|
||||
{
|
||||
$optionsAsArray = [
|
||||
@ -114,6 +136,9 @@ class SoapClientOptions
|
||||
if ($this->hasProxy()) {
|
||||
$optionsAsArray += $this->getProxy()->toArray();
|
||||
}
|
||||
if ($this->hasLocation()) {
|
||||
$optionsAsArray['location'] = $this->getLocation();
|
||||
}
|
||||
|
||||
return $optionsAsArray;
|
||||
}
|
||||
|
@ -2,12 +2,55 @@
|
||||
|
||||
namespace BeSimple\SoapClient;
|
||||
|
||||
use BeSimple\SoapCommon\SoapRequest;
|
||||
use BeSimple\SoapCommon\SoapResponse as CommonSoapResponse;
|
||||
|
||||
class SoapResponse extends CommonSoapResponse
|
||||
{
|
||||
/** @var mixed */
|
||||
protected $responseObject;
|
||||
/** @var SoapResponseTracingData */
|
||||
protected $tracingData;
|
||||
/** @var SoapRequest */
|
||||
protected $request;
|
||||
|
||||
public function getResponseContent()
|
||||
{
|
||||
return $this->getContent();
|
||||
}
|
||||
|
||||
public function getResponseObject()
|
||||
{
|
||||
return $this->responseObject;
|
||||
}
|
||||
|
||||
public function setResponseObject($responseObject)
|
||||
{
|
||||
$this->responseObject = $responseObject;
|
||||
}
|
||||
|
||||
public function hasTracingData()
|
||||
{
|
||||
return $this->tracingData !== null;
|
||||
}
|
||||
|
||||
public function getTracingData()
|
||||
{
|
||||
return $this->tracingData;
|
||||
}
|
||||
|
||||
public function setTracingData(SoapResponseTracingData $tracingData)
|
||||
{
|
||||
$this->tracingData = $tracingData;
|
||||
}
|
||||
|
||||
public function setRequest(SoapRequest $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function getRequest()
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the BeSimpleSoapClient.
|
||||
*
|
||||
* (c) Christian Kerl <christian-kerl@web.de>
|
||||
* (c) Francis Besset <francis.besset@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace BeSimple\SoapClient\Tests;
|
||||
|
||||
use Symfony\Component\Process\PhpExecutableFinder;
|
||||
use Symfony\Component\Process\ProcessBuilder;
|
||||
|
||||
/**
|
||||
* @author francis.besset@gmail.com <francis.besset@gmail.com>
|
||||
*/
|
||||
abstract class AbstractWebServerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var ProcessBuilder
|
||||
*/
|
||||
static protected $webserver;
|
||||
static protected $websererPortLength;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
|
||||
self::markTestSkipped('PHP Webserver is available from PHP 5.4');
|
||||
}
|
||||
|
||||
$phpFinder = new PhpExecutableFinder();
|
||||
self::$webserver = ProcessBuilder::create(array(
|
||||
'exec', // used exec binary (https://github.com/symfony/symfony/issues/5759)
|
||||
$phpFinder->find(),
|
||||
'-S',
|
||||
sprintf('localhost:%d', WEBSERVER_PORT),
|
||||
'-t',
|
||||
__DIR__.DIRECTORY_SEPARATOR.'Fixtures',
|
||||
))->getProcess();
|
||||
|
||||
self::$webserver->start();
|
||||
usleep(100000);
|
||||
|
||||
self::$websererPortLength = strlen(WEBSERVER_PORT);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
self::$webserver->stop(0);
|
||||
usleep(100000);
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class AttachmentRequest extends AttachmentType
|
||||
{
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class AttachmentType
|
||||
{
|
||||
public $fileName;
|
||||
public $binaryData;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class BookInformation
|
||||
{
|
||||
public $type;
|
||||
public $isbn;
|
||||
public $author;
|
||||
public $title;
|
||||
}
|
@ -1,89 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definitions targetNamespace="http://ws.apache.org/axis2/mtomsample/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws.apache.org/axis2/mtomsample/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
|
||||
<types>
|
||||
<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://ws.apache.org/axis2/mtomsample/" xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
<xsd:import namespace="http://www.w3.org/2005/05/xmlmime"/>
|
||||
<xsd:complexType name="AttachmentType">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" name="fileName" type="xsd:string"/>
|
||||
<xsd:element minOccurs="0" name="binaryData" type="xmime:base64Binary"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="AttachmentRequest" type="tns:AttachmentType"/>
|
||||
<xsd:element name="AttachmentResponse" type="xsd:string"/>
|
||||
</xsd:schema>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.w3.org/2005/05/xmlmime">
|
||||
<xs:attribute name="contentType">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:minLength value="3"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="expectedContentTypes" type="xs:string"/>
|
||||
<xs:complexType name="base64Binary">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:base64Binary">
|
||||
<xs:attribute ref="xmime:contentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="hexBinary">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:hexBinary">
|
||||
<xs:attribute ref="xmime:contentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
</types>
|
||||
<message name="AttachmentResponse">
|
||||
<part name="part1" element="tns:AttachmentResponse">
|
||||
</part>
|
||||
</message>
|
||||
<message name="AttachmentRequest">
|
||||
<part name="part1" element="tns:AttachmentRequest">
|
||||
</part>
|
||||
</message>
|
||||
<portType name="MTOMServicePortType">
|
||||
<operation name="attachment">
|
||||
<input message="tns:AttachmentRequest" wsaw:Action="attachment">
|
||||
</input>
|
||||
<output message="tns:AttachmentResponse" wsaw:Action="http://schemas.xmlsoap.org/wsdl/MTOMServicePortType/AttachmentResponse">
|
||||
</output>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="MTOMServiceSOAP11Binding" type="tns:MTOMServicePortType">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="attachment">
|
||||
<soap:operation soapAction="attachment" style="document"/>
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<binding name="MTOMServiceSOAP12Binding" type="tns:MTOMServicePortType">
|
||||
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="attachment">
|
||||
<soap12:operation soapAction="attachment" style="document"/>
|
||||
<input>
|
||||
<soap12:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap12:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="MTOMSample">
|
||||
<port name="MTOMSampleSOAP12port_http" binding="tns:MTOMServiceSOAP12Binding">
|
||||
<soap12:address location="http://localhost:8080/axis2/services/MTOMSample.MTOMSampleSOAP12port_http/"/>
|
||||
</port>
|
||||
<port name="MTOMSampleSOAP11port_http" binding="tns:MTOMServiceSOAP11Binding">
|
||||
<soap:address location="http://localhost:8080/axis2/services/MTOMSample.MTOMSampleSOAP11port_http/"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
@ -1,162 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://service.besimple" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://service.besimple">
|
||||
<wsdl:documentation>BeSimpleSwaService</wsdl:documentation>
|
||||
<wsdl:types>
|
||||
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.besimple">
|
||||
<xs:complexType name="Exception">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="Exception" nillable="true" type="xs:anyType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:element name="Exception">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="Exception" nillable="true" type="ns:Exception"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="uploadFile">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="data" nillable="true" type="xs:base64Binary"/>
|
||||
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="uploadFileResponse">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="downloadFile">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="downloadFileResponse">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="data" nillable="true" type="xs:base64Binary"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="downloadFileRequest">
|
||||
<wsdl:part name="parameters" element="ns:downloadFile"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="downloadFileResponse">
|
||||
<wsdl:part name="parameters" element="ns:downloadFileResponse"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="Exception">
|
||||
<wsdl:part name="parameters" element="ns:Exception"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="uploadFileRequest">
|
||||
<wsdl:part name="parameters" element="ns:uploadFile"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="uploadFileResponse">
|
||||
<wsdl:part name="parameters" element="ns:uploadFileResponse"/>
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="BeSimpleSwaServicePortType">
|
||||
<wsdl:operation name="downloadFile">
|
||||
<wsdl:input message="ns:downloadFileRequest" wsaw:Action="urn:downloadFile"/>
|
||||
<wsdl:output message="ns:downloadFileResponse" wsaw:Action="urn:downloadFileResponse"/>
|
||||
<wsdl:fault message="ns:Exception" name="Exception" wsaw:Action="urn:downloadFileException"/>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="uploadFile">
|
||||
<wsdl:input message="ns:uploadFileRequest" wsaw:Action="urn:uploadFile"/>
|
||||
<wsdl:output message="ns:uploadFileResponse" wsaw:Action="urn:uploadFileResponse"/>
|
||||
<wsdl:fault message="ns:Exception" name="Exception" wsaw:Action="urn:uploadFileException"/>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="BeSimpleSwaServiceSoap11Binding" type="ns:BeSimpleSwaServicePortType">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
|
||||
<wsdl:operation name="downloadFile">
|
||||
<soap:operation soapAction="urn:downloadFile" style="document"/>
|
||||
<wsdl:input>
|
||||
<soap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="Exception">
|
||||
<soap:fault use="literal" name="Exception"/>
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="uploadFile">
|
||||
<soap:operation soapAction="urn:uploadFile" style="document"/>
|
||||
<wsdl:input>
|
||||
<soap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="Exception">
|
||||
<soap:fault use="literal" name="Exception"/>
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:binding name="BeSimpleSwaServiceSoap12Binding" type="ns:BeSimpleSwaServicePortType">
|
||||
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
|
||||
<wsdl:operation name="downloadFile">
|
||||
<soap12:operation soapAction="urn:downloadFile" style="document"/>
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal"/>
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="Exception">
|
||||
<soap12:fault use="literal" name="Exception"/>
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="uploadFile">
|
||||
<soap12:operation soapAction="urn:uploadFile" style="document"/>
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal"/>
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="Exception">
|
||||
<soap12:fault use="literal" name="Exception"/>
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:binding name="BeSimpleSwaServiceHttpBinding" type="ns:BeSimpleSwaServicePortType">
|
||||
<http:binding verb="POST"/>
|
||||
<wsdl:operation name="downloadFile">
|
||||
<http:operation location="BeSimpleSwaService/downloadFile"/>
|
||||
<wsdl:input>
|
||||
<mime:content type="text/xml" part="downloadFile"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" part="downloadFile"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="uploadFile">
|
||||
<http:operation location="BeSimpleSwaService/uploadFile"/>
|
||||
<wsdl:input>
|
||||
<mime:content type="text/xml" part="uploadFile"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" part="uploadFile"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="BeSimpleSwaService">
|
||||
<wsdl:port name="BeSimpleSwaServiceHttpSoap11Endpoint" binding="ns:BeSimpleSwaServiceSoap11Binding">
|
||||
<soap:address location="http://localhost:8080/axis2/services/BeSimpleSwaService.BeSimpleSwaServiceHttpSoap11Endpoint/"/>
|
||||
</wsdl:port>
|
||||
<wsdl:port name="BeSimpleSwaServiceHttpSoap12Endpoint" binding="ns:BeSimpleSwaServiceSoap12Binding">
|
||||
<soap12:address location="http://localhost:8080/axis2/services/BeSimpleSwaService.BeSimpleSwaServiceHttpSoap12Endpoint/"/>
|
||||
</wsdl:port>
|
||||
<wsdl:port name="BeSimpleSwaServiceHttpEndpoint" binding="ns:BeSimpleSwaServiceHttpBinding">
|
||||
<http:address location="http://localhost:8080/axis2/services/BeSimpleSwaService.BeSimpleSwaServiceHttpEndpoint/"/>
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
@ -1,184 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions targetNamespace="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns:wns="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns:tns="http://ws.sosnoski.com/library/types"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
|
||||
<schema elementFormDefault="qualified"
|
||||
targetNamespace="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<import namespace="http://ws.sosnoski.com/library/types"/>
|
||||
|
||||
<element name="getBook">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="isbn" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBookResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="getBookReturn" minOccurs="0" type="tns:BookInformation"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBooksByType">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="type" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBooksByTypeResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="getBooksByTypeReturn" minOccurs="0" maxOccurs="unbounded" type="tns:BookInformation"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="addBook">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="type" type="string"/>
|
||||
<element name="isbn" type="string"/>
|
||||
<element name="author" minOccurs="0" maxOccurs="unbounded" type="string"/>
|
||||
<element name="title" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="addBookResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="addBookReturn" type="boolean"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
</schema>
|
||||
|
||||
<schema elementFormDefault="qualified"
|
||||
targetNamespace="http://ws.sosnoski.com/library/types"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<complexType name="BookInformation">
|
||||
<sequence>
|
||||
<element name="author" minOccurs="0" maxOccurs="unbounded" type="string"/>
|
||||
<element name="title" type="string"/>
|
||||
</sequence>
|
||||
<attribute name="type" use="required" type="string"/>
|
||||
<attribute name="isbn" use="required" type="string"/>
|
||||
</complexType>
|
||||
|
||||
</schema>
|
||||
|
||||
</wsdl:types>
|
||||
|
||||
<wsdl:message name="getBookRequest">
|
||||
<wsdl:part element="wns:getBook" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBookResponse">
|
||||
<wsdl:part element="wns:getBookResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBooksByTypeRequest">
|
||||
<wsdl:part element="wns:getBooksByType" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBooksByTypeResponse">
|
||||
<wsdl:part element="wns:getBooksByTypeResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="addBookRequest">
|
||||
<wsdl:part element="wns:addBook" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="addBookResponse">
|
||||
<wsdl:part element="wns:addBookResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:portType name="Library">
|
||||
|
||||
<wsdl:operation name="getBook">
|
||||
<wsdl:input message="wns:getBookRequest" name="getBookRequest"/>
|
||||
<wsdl:output message="wns:getBookResponse" name="getBookResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="getBooksByType">
|
||||
<wsdl:input message="wns:getBooksByTypeRequest" name="getBooksByTypeRequest"/>
|
||||
<wsdl:output message="wns:getBooksByTypeResponse" name="getBooksByTypeResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="addBook">
|
||||
<wsdl:input message="wns:addBookRequest" name="addBookRequest"/>
|
||||
<wsdl:output message="wns:addBookResponse" name="addBookResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
</wsdl:portType>
|
||||
|
||||
<wsdl:binding name="LibrarySoapBinding" type="wns:Library">
|
||||
|
||||
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
|
||||
<wsdl:operation name="getBook">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:getBook"/>
|
||||
|
||||
<wsdl:input name="getBookRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="getBookResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="getBooksByType">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:getBooksByType"/>
|
||||
|
||||
<wsdl:input name="getBooksByTypeRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="getBooksByTypeResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="addBook">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:addBook"/>
|
||||
|
||||
<wsdl:input name="addBookRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="addBookResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
</wsdl:binding>
|
||||
|
||||
<wsdl:service name="library-signencr">
|
||||
|
||||
<wsdl:port binding="wns:LibrarySoapBinding" name="library">
|
||||
<wsdlsoap:address location="http://localhost:8080/axis2/services/library-signencr"/>
|
||||
</wsdl:port>
|
||||
|
||||
</wsdl:service>
|
||||
|
||||
</wsdl:definitions>
|
@ -1,184 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions targetNamespace="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns:wns="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns:tns="http://ws.sosnoski.com/library/types"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
|
||||
<schema elementFormDefault="qualified"
|
||||
targetNamespace="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<import namespace="http://ws.sosnoski.com/library/types"/>
|
||||
|
||||
<element name="getBook">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="isbn" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBookResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="getBookReturn" minOccurs="0" type="tns:BookInformation"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBooksByType">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="type" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBooksByTypeResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="getBooksByTypeReturn" minOccurs="0" maxOccurs="unbounded" type="tns:BookInformation"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="addBook">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="type" type="string"/>
|
||||
<element name="isbn" type="string"/>
|
||||
<element name="author" minOccurs="0" maxOccurs="unbounded" type="string"/>
|
||||
<element name="title" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="addBookResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="addBookReturn" type="boolean"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
</schema>
|
||||
|
||||
<schema elementFormDefault="qualified"
|
||||
targetNamespace="http://ws.sosnoski.com/library/types"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<complexType name="BookInformation">
|
||||
<sequence>
|
||||
<element name="author" minOccurs="0" maxOccurs="unbounded" type="string"/>
|
||||
<element name="title" type="string"/>
|
||||
</sequence>
|
||||
<attribute name="type" use="required" type="string"/>
|
||||
<attribute name="isbn" use="required" type="string"/>
|
||||
</complexType>
|
||||
|
||||
</schema>
|
||||
|
||||
</wsdl:types>
|
||||
|
||||
<wsdl:message name="getBookRequest">
|
||||
<wsdl:part element="wns:getBook" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBookResponse">
|
||||
<wsdl:part element="wns:getBookResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBooksByTypeRequest">
|
||||
<wsdl:part element="wns:getBooksByType" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBooksByTypeResponse">
|
||||
<wsdl:part element="wns:getBooksByTypeResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="addBookRequest">
|
||||
<wsdl:part element="wns:addBook" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="addBookResponse">
|
||||
<wsdl:part element="wns:addBookResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:portType name="Library">
|
||||
|
||||
<wsdl:operation name="getBook">
|
||||
<wsdl:input message="wns:getBookRequest" name="getBookRequest"/>
|
||||
<wsdl:output message="wns:getBookResponse" name="getBookResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="getBooksByType">
|
||||
<wsdl:input message="wns:getBooksByTypeRequest" name="getBooksByTypeRequest"/>
|
||||
<wsdl:output message="wns:getBooksByTypeResponse" name="getBooksByTypeResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="addBook">
|
||||
<wsdl:input message="wns:addBookRequest" name="addBookRequest"/>
|
||||
<wsdl:output message="wns:addBookResponse" name="addBookResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
</wsdl:portType>
|
||||
|
||||
<wsdl:binding name="LibrarySoapBinding" type="wns:Library">
|
||||
|
||||
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
|
||||
<wsdl:operation name="getBook">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:getBook"/>
|
||||
|
||||
<wsdl:input name="getBookRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="getBookResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="getBooksByType">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:getBooksByType"/>
|
||||
|
||||
<wsdl:input name="getBooksByTypeRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="getBooksByTypeResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="addBook">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:addBook"/>
|
||||
|
||||
<wsdl:input name="addBookRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="addBookResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
</wsdl:binding>
|
||||
|
||||
<wsdl:service name="library-username">
|
||||
|
||||
<wsdl:port binding="wns:LibrarySoapBinding" name="library">
|
||||
<wsdlsoap:address location="http://localhost:8080/axis2/services/library-username"/>
|
||||
</wsdl:port>
|
||||
|
||||
</wsdl:service>
|
||||
|
||||
</wsdl:definitions>
|
@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class addBook
|
||||
{
|
||||
public $type;
|
||||
public $isbn;
|
||||
public $author;
|
||||
public $title;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class addBookResponse
|
||||
{
|
||||
public $addBookReturn;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class base64Binary
|
||||
{
|
||||
public $_;
|
||||
public $contentType;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICoDCCAgkCBEnhw2IwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAk5aMRMw
|
||||
EQYDVQQIEwpXZWxsaW5ndG9uMRowGAYDVQQHExFQYXJhcGFyYXVtdSBCZWFjaDEq
|
||||
MCgGA1UEChMhU29zbm9za2kgU29mdHdhcmUgQXNzb2NpYXRlcyBMdGQuMRAwDgYD
|
||||
VQQLEwdVbmtub3duMRgwFgYDVQQDEw9EZW5uaXMgU29zbm9za2kwHhcNMDkwNDEy
|
||||
MTAzMzA2WhcNMzYwODI3MTAzMzA2WjCBljELMAkGA1UEBhMCTloxEzARBgNVBAgT
|
||||
CldlbGxpbmd0b24xGjAYBgNVBAcTEVBhcmFwYXJhdW11IEJlYWNoMSowKAYDVQQK
|
||||
EyFTb3Nub3NraSBTb2Z0d2FyZSBBc3NvY2lhdGVzIEx0ZC4xEDAOBgNVBAsTB1Vu
|
||||
a25vd24xGDAWBgNVBAMTD0Rlbm5pcyBTb3Nub3NraTCBnzANBgkqhkiG9w0BAQEF
|
||||
AAOBjQAwgYkCgYEAhOVyNK8xyxtb4DnKtU6mF9KoiFqCk7eKoLE26+9h410CtTkx
|
||||
zWAfgnR+8i+LPbdsPY+yXAo6NYpCCKolXfDLe+AG2GwnMZGrIl6+BLF3hqTmIXBF
|
||||
TLGUmC7A7uBTivaWgdH1w3hb33rASoVU67BVtQ3QQi99juZX4vU9o9pScocCAwEA
|
||||
ATANBgkqhkiG9w0BAQUFAAOBgQBMNPo1KAGbz8Jl6HGbtAcetieSJ3bEAXmv1tcj
|
||||
ysBS67AXzdu1Ac+onHh2EpzBM7kuGbw+trU+AhulooPpewIQRApXP1F0KHRDcbqW
|
||||
jwvknS6HnomN9572giLGKn2601bHiRUj35hiA8aLmMUBppIRPFFAoQ0QUBCPx+m8
|
||||
/0n33w==
|
||||
-----END CERTIFICATE-----
|
@ -1,14 +0,0 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAITlcjSvMcsbW+A5yrVOphfSqIha
|
||||
gpO3iqCxNuvvYeNdArU5Mc1gH4J0fvIviz23bD2PslwKOjWKQgiqJV3wy3vgBthsJzGRqyJevgSx
|
||||
d4ak5iFwRUyxlJguwO7gU4r2loHR9cN4W996wEqFVOuwVbUN0EIvfY7mV+L1PaPaUnKHAgMBAAEC
|
||||
gYAZ6UqtLwN8YGc3fs0hMKZ9upsViuAuwPiMgED/G3twgzAF+ZLWQkmie+hMfCyf6eV200+pVm0n
|
||||
Bz/8xH/oowxpX0Kk3szoB4vFghjU84GKUcrbhu/NRIm7l3drnfbzqhQkHDCx6n1CotI4Gs49cDWu
|
||||
4uEAuxJkEIVY553unZjZgQJBAOJVIallNKmD0iQlvtWRmRzpmYDjt9vhNY6WBTIOx6SDn9SRaoSA
|
||||
fkipQ2HXo04r78TQ674+zfZ1lRTkFG7px6ECQQCWUPHp3pSZOM1oGzJrNvNaw+MizZAZjq34npHm
|
||||
9GRquFLG7BlCaI9QNGE7pN2ryYsYCRUMaM2e4GR0tUXxVGknAkAgrxqFU9AfCqI2Bh1gyf3KZxF7
|
||||
w2axofwR8ygc6nV6FGfoUneHWubhp0/LuVAj4cRmL6Vbe8ZSaPh2Y9lviuMBAkEAicP8Q+1E4j1m
|
||||
PPEYP51oYprANOiUFmhnWEL00+jPk+QFsd03tV6hYs/vAbwzkjuwqMHCMdJoCiH8z95IEUvc5wJA
|
||||
MvLOuZdu4dmhOXg/YKsbMSPjFNEVskLQNSXqw6O2wIrpPg1NQvBBAOTbiuZj3vind4VPos1wc4vB
|
||||
QocvdUC6dA==
|
||||
-----END PRIVATE KEY-----
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class downloadFile
|
||||
{
|
||||
public $name;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class downloadFileResponse
|
||||
{
|
||||
public $data;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class getBook
|
||||
{
|
||||
public $isbn;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class getBookResponse
|
||||
{
|
||||
public $getBookReturn;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class getBooksByType
|
||||
{
|
||||
public $type;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class getBooksByTypeResponse
|
||||
{
|
||||
public $getBooksByTypeReturn;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 74 KiB |
@ -1,17 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICoDCCAgkCBEnhwzMwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAk5aMRMw
|
||||
EQYDVQQIEwpXZWxsaW5ndG9uMRowGAYDVQQHExFQYXJhcGFyYXVtdSBCZWFjaDEq
|
||||
MCgGA1UEChMhU29zbm9za2kgU29mdHdhcmUgQXNzb2NpYXRlcyBMdGQuMRAwDgYD
|
||||
VQQLEwdVbmtub3duMRgwFgYDVQQDEw9EZW5uaXMgU29zbm9za2kwHhcNMDkwNDEy
|
||||
MTAzMjE5WhcNMzYwODI3MTAzMjE5WjCBljELMAkGA1UEBhMCTloxEzARBgNVBAgT
|
||||
CldlbGxpbmd0b24xGjAYBgNVBAcTEVBhcmFwYXJhdW11IEJlYWNoMSowKAYDVQQK
|
||||
EyFTb3Nub3NraSBTb2Z0d2FyZSBBc3NvY2lhdGVzIEx0ZC4xEDAOBgNVBAsTB1Vu
|
||||
a25vd24xGDAWBgNVBAMTD0Rlbm5pcyBTb3Nub3NraTCBnzANBgkqhkiG9w0BAQEF
|
||||
AAOBjQAwgYkCgYEA1H3mjQCF9uce2jmm/Yq9kE4ytfvkp4c8G90cDfJXJvOiGQds
|
||||
p2vDZXKuCkHQ7vsBBXPNTt8J/d8ZbEwyuB9Ccz5pJqi6Ig6Y2/mEsPthDyh5SrJV
|
||||
yQ/wxUGwmfSuwdrIMnplMTq+OR9BOfT3CvjSvuy9d6BQNo4wOMkDvmZTtI8CAwEA
|
||||
ATANBgkqhkiG9w0BAQUFAAOBgQCqv4475QaqlKcN2QCZJbLVKZEX+76XLQurGkgf
|
||||
2fCgesRHjfUfOHyTTlhWQdEKTcBB2XviUyyW6I//fmKfXUIiQqvgh4LHdXRPEXDf
|
||||
Y9nr89MjyQpDlnl6AlrvSej30a9iwVRUeVk4d6gxWHMRonKBFgh+TGexxUXHtPkf
|
||||
B1Pdtg==
|
||||
-----END CERTIFICATE-----
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class uploadFile
|
||||
{
|
||||
public $data;
|
||||
public $name;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class uploadFileResponse
|
||||
{
|
||||
public $return;
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Deploy "axis_services/sample-mtom.aar" to Apache Axis2 to get this
|
||||
* example to work.
|
||||
*
|
||||
* Apache Axis2 MTOM example.
|
||||
*
|
||||
*/
|
||||
|
||||
use BeSimple\SoapCommon\Helper as BeSimpleSoapHelper;
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\AttachmentRequest;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\AttachmentType;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\base64Binary;
|
||||
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\TestCase;
|
||||
|
||||
class MtomAxisInteropTest extends TestCase
|
||||
{
|
||||
private $options = array(
|
||||
'soap_version' => SOAP_1_1,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'attachment_type' => BeSimpleSoapHelper::ATTACHMENTS_TYPE_MTOM,
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'classmap' => array(
|
||||
'base64Binary' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\base64Binary',
|
||||
'AttachmentRequest' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\AttachmentRequest',
|
||||
),
|
||||
'proxy_host' => false,
|
||||
);
|
||||
|
||||
public function testAttachment()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/MTOM.wsdl', $this->options);
|
||||
|
||||
$b64 = new base64Binary();
|
||||
$b64->_ = 'This is a test. :)';
|
||||
$b64->contentType = 'text/plain';
|
||||
|
||||
$attachment = new AttachmentRequest();
|
||||
$attachment->fileName = 'test123.txt';
|
||||
$attachment->binaryData = $b64;
|
||||
|
||||
$this->assertEquals('File saved succesfully.', $sc->attachment($attachment));
|
||||
|
||||
// $fileCreatedByServer = __DIR__.'/'.$attachment->fileName;
|
||||
// $this->assertEquals($b64->_, file_get_contents($fileCreatedByServer));
|
||||
// unlink($fileCreatedByServer);
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
<project name="BeSimpleSwaService" default="generate.service">
|
||||
<property environment="env" />
|
||||
<property name="axis2.home" value="C:/axis2" />
|
||||
<property name="axis2.repo" value="${axis2.home}/repository" />
|
||||
<property name="build.dir" value="build" />
|
||||
<property name="filename" value="besimple-swa.aar" />
|
||||
|
||||
<path id="axis.classpath">
|
||||
<fileset dir="${axis2.home}/lib">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<target name="generate.service" depends="compile">
|
||||
<jar destfile="${build.dir}/${filename}">
|
||||
<fileset dir="resources/">
|
||||
<include name="META-INF/services.xml" />
|
||||
</fileset>
|
||||
<fileset dir="${build.dir}/classes">
|
||||
<include name="besimple/service/**/*.class" />
|
||||
</fileset>
|
||||
</jar>
|
||||
<copy file="${build.dir}/${filename}" tofile="../axis_services/${filename}" overwrite="true" />
|
||||
<copy file="${build.dir}/${filename}" tofile="${axis2.repo}/services/${filename}" overwrite="true" />
|
||||
<antcall target="clean" />
|
||||
</target>
|
||||
|
||||
<target name="compile">
|
||||
<mkdir dir="${build.dir}/classes" />
|
||||
<javac debug="on" srcdir="src" destdir="${build.dir}/classes">
|
||||
<classpath refid="axis.classpath" />
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete dir="${build.dir}" />
|
||||
</target>
|
||||
</project>
|
@ -1,15 +0,0 @@
|
||||
<serviceGroup>
|
||||
<service name="BeSimpleSwaService">
|
||||
<description>BeSimple test service for SwA.</description>
|
||||
<parameter name="enableSwA">true</parameter>
|
||||
<parameter name="ServiceClass" locked="false">besimple.service.BeSimpleSwaService</parameter>
|
||||
<operation name="uploadFile">
|
||||
<actionMapping>urn:uploadFile</actionMapping>
|
||||
<messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
|
||||
</operation>
|
||||
<operation name="downloadFile">
|
||||
<actionMapping>urn:downloadFile</actionMapping>
|
||||
<messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
|
||||
</operation>
|
||||
</service>
|
||||
</serviceGroup>
|
@ -1,78 +0,0 @@
|
||||
package besimple.service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import javax.activation.DataHandler;
|
||||
import javax.activation.FileDataSource;
|
||||
|
||||
import org.apache.axiom.attachments.Attachments;
|
||||
import org.apache.axiom.om.OMAbstractFactory;
|
||||
import org.apache.axiom.om.OMAttribute;
|
||||
import org.apache.axiom.om.OMElement;
|
||||
import org.apache.axiom.om.OMFactory;
|
||||
import org.apache.axiom.om.OMNamespace;
|
||||
|
||||
import org.apache.axis2.context.MessageContext;
|
||||
import org.apache.axis2.context.OperationContext;
|
||||
import org.apache.axis2.wsdl.WSDLConstants;
|
||||
|
||||
public class BeSimpleSwaService {
|
||||
|
||||
String namespace = "http://service.besimple";
|
||||
|
||||
public OMElement uploadFile(OMElement element) throws Exception {
|
||||
OMElement dataElement = (OMElement)element.getFirstChildWithName(new QName(namespace, "data"));
|
||||
OMAttribute hrefAttribute = dataElement.getAttribute(new QName("href"));
|
||||
|
||||
String contentID = hrefAttribute.getAttributeValue();
|
||||
contentID = contentID.trim();
|
||||
if (contentID.substring(0, 3).equalsIgnoreCase("cid")) {
|
||||
contentID = contentID.substring(4);
|
||||
}
|
||||
OMElement nameElement = (OMElement)element.getFirstChildWithName(new QName(namespace, "name"));
|
||||
String name = nameElement.getText();
|
||||
|
||||
MessageContext msgCtx = MessageContext.getCurrentMessageContext();
|
||||
Attachments attachment = msgCtx.getAttachmentMap();
|
||||
DataHandler dataHandler = attachment.getDataHandler(contentID);
|
||||
|
||||
File file = new File(name);
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(file);
|
||||
dataHandler.writeTo(fileOutputStream);
|
||||
fileOutputStream.flush();
|
||||
fileOutputStream.close();
|
||||
|
||||
OMFactory factory = OMAbstractFactory.getOMFactory();
|
||||
OMNamespace omNs = factory.createOMNamespace(namespace, "swa");
|
||||
OMElement wrapperElement = factory.createOMElement("uploadFileResponse", omNs);
|
||||
OMElement returnElement = factory.createOMElement("return", omNs, wrapperElement);
|
||||
returnElement.setText("File saved succesfully.");
|
||||
|
||||
return wrapperElement;
|
||||
}
|
||||
|
||||
public OMElement downloadFile(OMElement element) throws Exception {
|
||||
OMElement nameElement = (OMElement)element.getFirstChildWithName(new QName(namespace, "name"));
|
||||
String name = nameElement.getText();
|
||||
|
||||
MessageContext msgCtxIn = MessageContext.getCurrentMessageContext();
|
||||
OperationContext operationContext = msgCtxIn.getOperationContext();
|
||||
MessageContext msgCtxOut = operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
|
||||
|
||||
FileDataSource fileDataSource = new FileDataSource(name);
|
||||
DataHandler dataHandler = new DataHandler(fileDataSource);
|
||||
|
||||
String contentID = "cid:" + msgCtxOut.addAttachment(dataHandler);
|
||||
|
||||
OMFactory factory = OMAbstractFactory.getOMFactory();
|
||||
OMNamespace omNs = factory.createOMNamespace(namespace, "swa");
|
||||
OMElement wrapperElement = factory.createOMElement("downloadFileResponse", omNs);
|
||||
OMElement dataElement = factory.createOMElement("data", omNs, wrapperElement);
|
||||
dataElement.addAttribute("href", contentID, null);
|
||||
|
||||
return wrapperElement;
|
||||
}
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Deploy "axis_services/besimple-swa.aar" to Apache Axis2 to get this
|
||||
* example to work.
|
||||
*
|
||||
* Run ant to rebuild aar.
|
||||
*
|
||||
* Example based on:
|
||||
* http://axis.apache.org/axis2/java/core/docs/mtom-guide.html#a3
|
||||
* http://wso2.org/library/1675
|
||||
*
|
||||
* Doesn't work directly with ?wsdl served by Apache Axis!
|
||||
*
|
||||
*/
|
||||
|
||||
use BeSimple\SoapCommon\Helper as BeSimpleSoapHelper;
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\uploadFile;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\uploadFileResponse;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\downloadFile;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\downloadFileResponse;
|
||||
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\TestCase;
|
||||
|
||||
class SwaAxisInteropTest extends TestCase
|
||||
{
|
||||
private $options = array(
|
||||
'soap_version' => SOAP_1_1,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'attachment_type' => BeSimpleSoapHelper::ATTACHMENTS_TYPE_SWA,
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'classmap' => array(
|
||||
'downloadFile' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\downloadFile',
|
||||
'downloadFileResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\downloadFileResponse',
|
||||
'uploadFile' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\uploadFile',
|
||||
'uploadFileResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\uploadFileResponse',
|
||||
),
|
||||
'proxy_host' => false,
|
||||
);
|
||||
|
||||
public function testUploadDownloadText()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/SwA.wsdl', $this->options);
|
||||
|
||||
$upload = new uploadFile();
|
||||
$upload->name = 'upload.txt';
|
||||
$upload->data = 'This is a test. :)';
|
||||
$result = $sc->uploadFile($upload);
|
||||
|
||||
$this->assertEquals('File saved succesfully.', $result->return);
|
||||
|
||||
$download = new downloadFile();
|
||||
$download->name = 'upload.txt';
|
||||
$result = $sc->downloadFile($download);
|
||||
|
||||
$this->assertEquals($upload->data, $result->data);
|
||||
}
|
||||
|
||||
public function testUploadDownloadImage()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/SwA.wsdl', $this->options);
|
||||
|
||||
$upload = new uploadFile();
|
||||
$upload->name = 'image.jpg';
|
||||
$upload->data = file_get_contents(__DIR__.'/Fixtures/image.jpg'); // source: http://www.freeimageslive.com/galleries/light/pics/swirl3768.jpg;
|
||||
$result = $sc->uploadFile($upload);
|
||||
|
||||
$this->assertEquals('File saved succesfully.', $result->return);
|
||||
|
||||
$download = new downloadFile();
|
||||
$download->name = 'image.jpg';
|
||||
$result = $sc->downloadFile($download);
|
||||
|
||||
$this->assertEquals($upload->data, $result->data);
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\AxisInterop;
|
||||
|
||||
class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
$ch = curl_init('http://localhost:8080/');
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||
curl_setopt($ch, CURLOPT_HEADER, true);
|
||||
curl_setopt($ch, CURLOPT_NOBODY, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
if (curl_exec($ch) === false) {
|
||||
$this->markTestSkipped(
|
||||
'The Axis server is not started on port 8080.'
|
||||
);
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
}
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Deploy "axis_services/version2.aar" to Apache Axis2 to get this example to
|
||||
* work.
|
||||
*
|
||||
* To rebuild the "axis_services/version2.aar" the following steps need to be
|
||||
* done to build a working Apache Axis2 version service with SOAP session
|
||||
* enabled.
|
||||
*
|
||||
* 1) Go to $AXIS_HOME/samples/version and edit the following files:
|
||||
*
|
||||
* resources/META-INF/services.xml:
|
||||
* <service name="Version2" scope="soapsession">
|
||||
* ...
|
||||
* </service>
|
||||
*
|
||||
* build.xml:
|
||||
* replace version.aar with version2.aar
|
||||
*
|
||||
* 2) Run ant build.xml in "$AXIS_HOME/samples/version"
|
||||
*
|
||||
*/
|
||||
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
use BeSimple\SoapClient\WsAddressingFilter as BeSimpleWsAddressingFilter;
|
||||
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\TestCase;
|
||||
|
||||
class WsAddressingAxisInteropTest extends TestCase
|
||||
{
|
||||
private $options = array(
|
||||
'soap_version' => SOAP_1_2,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'proxy_host' => false,
|
||||
);
|
||||
|
||||
public function testSession()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient('http://localhost:8080/axis2/services/Version2?wsdl', $this->options);
|
||||
$soapKernel = $sc->getSoapKernel();
|
||||
$wsaFilter = new BeSimpleWsAddressingFilter();
|
||||
$soapKernel->registerFilter($wsaFilter);
|
||||
|
||||
$wsaFilter->setReplyTo(BeSimpleWsAddressingFilter::ENDPOINT_REFERENCE_ANONYMOUS);
|
||||
$wsaFilter->setMessageId();
|
||||
|
||||
$version = $sc->getVersion();
|
||||
|
||||
$soapSessionId1 = $wsaFilter->getReferenceParameter('http://ws.apache.org/namespaces/axis2', 'ServiceGroupId');
|
||||
|
||||
$wsaFilter->addReferenceParameter('http://ws.apache.org/namespaces/axis2', 'axis2', 'ServiceGroupId', $soapSessionId1);
|
||||
|
||||
$version = $sc->getVersion();
|
||||
|
||||
$soapSessionId2 = $wsaFilter->getReferenceParameter('http://ws.apache.org/namespaces/axis2', 'ServiceGroupId');
|
||||
|
||||
$this->assertEquals($soapSessionId1, $soapSessionId2);
|
||||
}
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Deploy "axis_services/library-signencr.aar" to Apache Axis2 to get this
|
||||
* example to work.
|
||||
*
|
||||
* Links:
|
||||
* http://www.dcc.uchile.cl/~pcamacho/tutorial/web/xmlsec/xmlsec.html
|
||||
* http://www.aleksey.com/xmlsec/xmldsig-verifier.html
|
||||
*
|
||||
* Using code from axis example:
|
||||
* http://www.ibm.com/developerworks/java/library/j-jws5/index.html
|
||||
*
|
||||
* Download key tool to export private key
|
||||
* http://couchpotato.net/pkeytool/
|
||||
*
|
||||
* keytool -export -alias serverkey -keystore server.keystore -storepass nosecret -file servercert.cer
|
||||
* openssl x509 -out servercert.pem -outform pem -in servercert.pem -inform der
|
||||
*
|
||||
* keytool -export -alias clientkey -keystore client.keystore -storepass nosecret -file clientcert.cer
|
||||
* openssl x509 -out clientcert.pem -outform pem -in clientcert.pem -inform der
|
||||
* java -jar pkeytool.jar -exportkey -keystore client.keystore -storepass nosecret -keypass clientpass -rfc -alias clientkey -file clientkey.pem
|
||||
*
|
||||
* C:\Program Files\Java\jre6\bin\keytool -export -alias serverkey -keystore server.keystore -storepass nosecret -file servercert.cer
|
||||
* C:\xampp\apache\bin\openssl x509 -out servercert.pem -outform pem -in servercert.cer -inform der
|
||||
*
|
||||
* C:\Program Files\Java\jre6\bin\keytool -export -alias clientkey -keystore client.keystore -storepass nosecret -file clientcert.cer
|
||||
* C:\xampp\apache\bin\openssl x509 -out clientcert.pem -outform pem -in clientcert.cer -inform der
|
||||
* java -jar C:\axis2\pkeytool\pkeytool.jar -exportkey -keystore client.keystore -storepass nosecret -keypass clientpass -rfc -alias clientkey -file clientkey.pem
|
||||
*
|
||||
* build.properties:
|
||||
* server-policy=hash-policy-server.xml
|
||||
*
|
||||
* allows both text and digest!
|
||||
*/
|
||||
|
||||
use ass\XmlSecurity\Key as XmlSecurityKey;
|
||||
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
use BeSimple\SoapClient\WsSecurityFilter as BeSimpleWsSecurityFilter;
|
||||
use BeSimple\SoapCommon\WsSecurityKey as BeSimpleWsSecurityKey;
|
||||
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBook;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBookResponse;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBooksByType;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBooksByTypeResponse;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBook;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBookResponse;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\BookInformation;
|
||||
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\TestCase;
|
||||
|
||||
class WsSecuritySigEncAxisInteropTest extends TestCase
|
||||
{
|
||||
private $options = array(
|
||||
'soap_version' => SOAP_1_2,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'classmap' => array(
|
||||
'getBook' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBook',
|
||||
'getBookResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBookResponse',
|
||||
'getBooksByType' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBooksByType',
|
||||
'getBooksByTypeResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBooksByTypeResponse',
|
||||
'addBook' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBook',
|
||||
'addBookResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBookResponse',
|
||||
'BookInformation' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\BookInformation',
|
||||
),
|
||||
'proxy_host' => false,
|
||||
);
|
||||
|
||||
public function testSigEnc()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/WsSecuritySigEnc.wsdl', $this->options);
|
||||
|
||||
$wssFilter = new BeSimpleWsSecurityFilter();
|
||||
// user key for signature and encryption
|
||||
$securityKeyUser = new BeSimpleWsSecurityKey();
|
||||
$securityKeyUser->addPrivateKey(XmlSecurityKey::RSA_SHA1, __DIR__.'/Fixtures/clientkey.pem', true);
|
||||
$securityKeyUser->addPublicKey(XmlSecurityKey::RSA_SHA1, __DIR__.'/Fixtures/clientcert.pem', true);
|
||||
$wssFilter->setUserSecurityKeyObject($securityKeyUser);
|
||||
// service key for encryption
|
||||
$securityKeyService = new BeSimpleWsSecurityKey();
|
||||
$securityKeyService->addPrivateKey(XmlSecurityKey::TRIPLEDES_CBC);
|
||||
$securityKeyService->addPublicKey(XmlSecurityKey::RSA_1_5, __DIR__.'/Fixtures/servercert.pem', true);
|
||||
$wssFilter->setServiceSecurityKeyObject($securityKeyService);
|
||||
// TOKEN_REFERENCE_SUBJECT_KEY_IDENTIFIER | TOKEN_REFERENCE_SECURITY_TOKEN | TOKEN_REFERENCE_THUMBPRINT_SHA1
|
||||
$wssFilter->setSecurityOptionsSignature(BeSimpleWsSecurityFilter::TOKEN_REFERENCE_SECURITY_TOKEN);
|
||||
$wssFilter->setSecurityOptionsEncryption(BeSimpleWsSecurityFilter::TOKEN_REFERENCE_THUMBPRINT_SHA1);
|
||||
|
||||
$soapKernel = $sc->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
||||
$gb = new getBook();
|
||||
$gb->isbn = '0061020052';
|
||||
$result = $sc->getBook($gb);
|
||||
$this->assertInstanceOf('BeSimple\SoapClient\Tests\AxisInterop\Fixtures\BookInformation', $result->getBookReturn);
|
||||
|
||||
$ab = new addBook();
|
||||
$ab->isbn = '0445203498';
|
||||
$ab->title = 'The Dragon Never Sleeps';
|
||||
$ab->author = 'Cook, Glen';
|
||||
$ab->type = 'scifi';
|
||||
|
||||
$this->assertTrue((bool) $sc->addBook($ab));
|
||||
|
||||
// getBooksByType("scifi");
|
||||
}
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Deploy "axis_services/library-username-digest.aar" to Apache Axis2 to get
|
||||
* this example to work.
|
||||
*
|
||||
* Using code from axis example:
|
||||
* http://www.ibm.com/developerworks/java/library/j-jws4/index.html
|
||||
*
|
||||
* build.properties:
|
||||
* server-policy=hash-policy-server.xml
|
||||
*
|
||||
* allows both text and digest!
|
||||
*/
|
||||
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
use BeSimple\SoapClient\WsSecurityFilter as BeSimpleWsSecurityFilter;
|
||||
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBook;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBookResponse;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBooksByType;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBooksByTypeResponse;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBook;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBookResponse;
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\Fixtures\BookInformation;
|
||||
|
||||
use BeSimple\SoapClient\Tests\AxisInterop\TestCase;
|
||||
|
||||
class WsSecurityUserPassAxisInteropTest extends TestCase
|
||||
{
|
||||
private $options = array(
|
||||
'soap_version' => SOAP_1_2,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'classmap' => array(
|
||||
'getBook' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBook',
|
||||
'getBookResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBookResponse',
|
||||
'getBooksByType' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBooksByType',
|
||||
'getBooksByTypeResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\getBooksByTypeResponse',
|
||||
'addBook' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBook',
|
||||
'addBookResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBookResponse',
|
||||
'BookInformation' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\BookInformation',
|
||||
),
|
||||
'proxy_host' => false,
|
||||
);
|
||||
|
||||
public function testUserPassText()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/WsSecurityUserPass.wsdl', $this->options);
|
||||
|
||||
$wssFilter = new BeSimpleWsSecurityFilter(true, 600);
|
||||
$wssFilter->addUserData('libuser', 'books', BeSimpleWsSecurityFilter::PASSWORD_TYPE_TEXT);
|
||||
|
||||
$soapKernel = $sc->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
||||
$gb = new getBook();
|
||||
$gb->isbn = '0061020052';
|
||||
$result = $sc->getBook($gb);
|
||||
$this->assertInstanceOf('BeSimple\SoapClient\Tests\AxisInterop\Fixtures\BookInformation', $result->getBookReturn);
|
||||
|
||||
$ab = new addBook();
|
||||
$ab->isbn = '0445203498';
|
||||
$ab->title = 'The Dragon Never Sleeps';
|
||||
$ab->author = 'Cook, Glen';
|
||||
$ab->type = 'scifi';
|
||||
|
||||
$this->assertTrue((bool) $sc->addBook($ab));
|
||||
|
||||
// getBooksByType("scifi");
|
||||
}
|
||||
|
||||
public function testUserPassDigest()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/WsSecurityUserPass.wsdl', $this->options);
|
||||
|
||||
$wssFilter = new BeSimpleWsSecurityFilter(true, 600);
|
||||
$wssFilter->addUserData( 'libuser', 'books', BeSimpleWsSecurityFilter::PASSWORD_TYPE_DIGEST );
|
||||
|
||||
$soapKernel = $sc->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
||||
$gb = new getBook();
|
||||
$gb->isbn = '0061020052';
|
||||
$result = $sc->getBook($gb);
|
||||
$this->assertInstanceOf('BeSimple\SoapClient\Tests\AxisInterop\Fixtures\BookInformation', $result->getBookReturn);
|
||||
|
||||
$ab = new addBook();
|
||||
$ab->isbn = '0445203498';
|
||||
$ab->title = 'The Dragon Never Sleeps';
|
||||
$ab->author = 'Cook, Glen';
|
||||
$ab->type = 'scifi';
|
||||
|
||||
$this->assertTrue((bool) $sc->addBook($ab));
|
||||
|
||||
// getBooksByType("scifi");
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,86 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the BeSimpleSoapClient.
|
||||
*
|
||||
* (c) Christian Kerl <christian-kerl@web.de>
|
||||
* (c) Francis Besset <francis.besset@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace BeSimple\SoapClient\Tests;
|
||||
|
||||
use BeSimple\SoapClient\Curl\Curl;
|
||||
use BeSimple\SoapClient\Curl\CurlOptionsBuilder;
|
||||
|
||||
/**
|
||||
* @author Andreas Schamberger <mail@andreass.net>
|
||||
*/
|
||||
class CurlTest extends AbstractWebserverTest
|
||||
{
|
||||
public function testExec()
|
||||
{
|
||||
$curlOptions = CurlOptionsBuilder::buildDefault();
|
||||
$curl = new Curl(
|
||||
$curlOptions
|
||||
);
|
||||
|
||||
$this->assertTrue($curl->executeCurl($curlOptions, sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT)));
|
||||
$this->assertTrue($curl->exec(sprintf('http://localhost:%d/404.txt', WEBSERVER_PORT)));
|
||||
}
|
||||
|
||||
public function testGetErrorMessage()
|
||||
{
|
||||
$curl = new Curl(array(
|
||||
'proxy_host' => false,
|
||||
));
|
||||
|
||||
$curl->exec('http://unknown/curl.txt');
|
||||
$this->assertEquals('Could not connect to host', $curl->getErrorMessage());
|
||||
|
||||
$curl->exec(sprintf('xyz://localhost:%d/@404.txt', WEBSERVER_PORT));
|
||||
$this->assertEquals('Unknown protocol. Only http and https are allowed.', $curl->getErrorMessage());
|
||||
|
||||
$curl->exec('');
|
||||
$this->assertEquals('Unable to parse URL', $curl->getErrorMessage());
|
||||
}
|
||||
|
||||
public function testGetRequestHeaders()
|
||||
{
|
||||
$curl = new Curl(array(
|
||||
'proxy_host' => false,
|
||||
));
|
||||
|
||||
$curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT));
|
||||
$this->assertEquals(132 + self::$websererPortLength, strlen($curl->getRequestHeaders()));
|
||||
|
||||
$curl->exec(sprintf('http://localhost:%s/404.txt', WEBSERVER_PORT));
|
||||
$this->assertEquals(131 + self::$websererPortLength, strlen($curl->getRequestHeaders()));
|
||||
}
|
||||
|
||||
public function testGetResponse()
|
||||
{
|
||||
$curl = new Curl(array(
|
||||
'proxy_host' => false,
|
||||
));
|
||||
|
||||
$curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT));
|
||||
$this->assertSame('OK', $curl->getResponseStatusMessage());
|
||||
$this->assertEquals(145 + self::$websererPortLength, strlen($curl->getResponse()));
|
||||
|
||||
$curl->exec(sprintf('http://localhost:%d/404.txt', WEBSERVER_PORT));
|
||||
$this->assertSame('Not Found', $curl->getResponseStatusMessage());
|
||||
}
|
||||
|
||||
public function testGetResponseBody()
|
||||
{
|
||||
$curl = new Curl(array(
|
||||
'proxy_host' => false,
|
||||
));
|
||||
|
||||
$curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT));
|
||||
$this->assertEquals('This is a testfile for cURL.', $curl->getResponseBody());
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
This is a testfile for cURL.
|
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://foobar/soap/User/1.0/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="User" targetNamespace="http://foobar/soap/User/1.0/">
|
||||
<portType name="UserPortType">
|
||||
<operation name="login" parameterOrder="username password">
|
||||
<input message="tns:loginRequest"/>
|
||||
<output message="tns:loginResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="UserBinding" type="tns:UserPortType">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="login">
|
||||
<soap:operation soapAction="http://foobar/soap/User/1.0/login"/>
|
||||
<input>
|
||||
<soap:body parts="username password" use="literal" namespace="http://foobar/soap/User/1.0/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body parts="return" use="literal" namespace="http://foobar/soap/User/1.0/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="UserService">
|
||||
<port name="UserPort" binding="tns:UserBinding">
|
||||
<soap:address location="http://foobar/soap/user"/>
|
||||
</port>
|
||||
</service>
|
||||
<types>
|
||||
<xsd:schema targetNamespace="http://foobar/soap/User/1.0/">
|
||||
<xsd:complexType name="User">
|
||||
<xsd:all>
|
||||
<xsd:element name="id" type="xsd:int" nillable="true"/>
|
||||
<xsd:element name="username" type="xsd:string"/>
|
||||
<xsd:element name="email" type="xsd:string"/>
|
||||
<xsd:element name="language" type="xsd:string"/>
|
||||
<xsd:element name="apiKey" type="xsd:string"/>
|
||||
<xsd:element name="subscriptionEndAt" type="xsd:dateTime" nillable="true"/>
|
||||
</xsd:all>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="loginRequest">
|
||||
<part name="username" type="xsd:string"/>
|
||||
<part name="password" type="xsd:string"/>
|
||||
</message>
|
||||
<message name="loginResponse">
|
||||
<part name="return" type="tns:User"/>
|
||||
</message>
|
||||
</definitions>
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<xs:element name="note">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="to" type="xs:string"/>
|
||||
<xs:element name="from" type="xs:string"/>
|
||||
<xs:element name="heading" type="xs:string"/>
|
||||
<xs:element name="body" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
</xs:schema>
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<wsdl:types xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://test.sample">
|
||||
<xs:element name="note">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="to" type="xs:string"/>
|
||||
<xs:element name="from" type="xs:string"/>
|
||||
<xs:element name="heading" type="xs:string"/>
|
||||
<xs:element name="body" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
</wsdl:types>
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<wsdl:documentation>wsdlincludetest</wsdl:documentation>
|
||||
<wsdl:include location="http://%location%/wsdl_include.wsdl"/>
|
||||
</wsdl:definitions>
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<wsdl:documentation>wsdlincludetest</wsdl:documentation>
|
||||
<wsdl:include location="../wsdl_include.wsdl"/>
|
||||
</wsdl:definitions>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<wsdl:documentation>xsdinctest</wsdl:documentation>
|
||||
<wsdl:types>
|
||||
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://test.sample">
|
||||
<xs:include schemaLocation="http://%location%/type_include.xsd"/>
|
||||
</xs:schema>
|
||||
</wsdl:types>
|
||||
</wsdl:definitions>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<wsdl:documentation>xsdinctest</wsdl:documentation>
|
||||
<wsdl:types>
|
||||
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://test.sample">
|
||||
<xs:include schemaLocation="../type_include.xsd"/>
|
||||
</xs:schema>
|
||||
</wsdl:types>
|
||||
</wsdl:definitions>
|
@ -1,23 +0,0 @@
|
||||
# HOW TO PREPARE Mock SWA Service
|
||||
|
||||
1. Create an test endpoint by using tools such as mockable.io, that will return response (expect POST requests with SOAP v1.1)
|
||||
similar to the one provided in example file src/BeSimple/SoapClient/Tests/Mock/MockSwaService.example.response
|
||||
and Content-Type headers from src/BeSimple/SoapClient/Tests/Mock/MockSwaService.example.response.headers
|
||||
|
||||
Example Endpoint URL: https://demo0580999.mockable.io/soap/testGenerator
|
||||
|
||||
2. Create a test WSDL endpoint that will return WSDL file from (expect GET requests)
|
||||
an example file src/BeSimple/SoapClient/Tests/Mock/MockSwaService.wsdl
|
||||
|
||||
Example WSDL endpoint URL: https://demo0580999.mockable.io/soap/testGenerator?WSDL
|
||||
|
||||
3. Take the two endpoints and configure SoapClientBuilderTest::TEST_ENDPOINT_SWA
|
||||
and SoapClientBuilderTest::TEST_REMOTE_WSDL_SWA variables
|
||||
|
||||
4. The test BeSimple\SoapClient\Tests\SoapClientBuilderTest::testSoapCallSwaWithAttachmentsOnResponse should work correctly.
|
||||
|
||||
If not, try to catch SoapFaultWithTracingData thrown by the soapCall method:
|
||||
|
||||
$soapClient->soapCall('generateTest', [$generateTestRequest]);
|
||||
|
||||
You can print the SoapFaultWithTracingData attributes in order to investigate the SoapClient request and request headers.
|
@ -1,18 +0,0 @@
|
||||
|
||||
--Part_13_58a1b01a466a6.58a1b01a466e8
|
||||
Content-Type: application/soap+xml; charset=utf-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Content-ID: <part-72f5d209-2631-42ee-81d1-e554af739ce6@response.info>
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://schema.testcase"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:generateTestResponse><rpc:result>generateTestReturn</rpc:result><generateTestReturn><fileName>dummy-attachment.txt</fileName></generateTestReturn></ns1:generateTestResponse></env:Body></env:Envelope>
|
||||
|
||||
--Part_13_58a1b01a466a6.58a1b01a466e8
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Content-ID: <dummy-attachment.txt>
|
||||
Content-Location: dummy-attachment.txt
|
||||
|
||||
Hello world!
|
||||
|
||||
--Part_13_58a1b01a466a6.58a1b01a466e8--
|
@ -1 +0,0 @@
|
||||
multipart/related; type="application/soap+xml"; charset=utf-8; boundary=Part_13_58a1b01a466a6.58a1b01a466e8; start="<part-72f5d209-2631-42ee-81d1-e554af739ce6@response.info>"
|
@ -1,61 +0,0 @@
|
||||
<?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="GenerateTestRequest">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="salutation" type="xsd:string" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="GenerateTestResponse">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="fileName" type="xsd:string" minOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<message name="SoapHeader">
|
||||
<part name="SoapHeader" element="tns:SoapHeader"/>
|
||||
</message>
|
||||
<message name="GenerateTestRequest">
|
||||
<part name="request" type="tns:GenerateTestRequest"/>
|
||||
</message>
|
||||
<message name="GenerateTestResponse">
|
||||
<part name="generateTestReturn" type="tns:GenerateTestResponse"/>
|
||||
</message>
|
||||
<wsdl:portType name="TestGeneratorServiceSoapPortType">
|
||||
<wsdl:operation name="generateTest">
|
||||
<wsdl:input message="tns:GenerateTestRequest"/>
|
||||
<wsdl:output message="tns:GenerateTestResponse"/>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<binding name="TestGeneratorServiceSoapBinding" type="tns:TestGeneratorServiceSoapPortType">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<wsdl:operation name="generateTest">
|
||||
<soap:operation soapAction="TestGeneratorService.generateTest" 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="TestGeneratorService">
|
||||
<xsd:documentation>WSDL file for TestGeneratorService</xsd:documentation>
|
||||
<port name="TestGeneratorServiceSoapPortType" binding="tns:TestGeneratorServiceSoapBinding">
|
||||
<soap:address location="https://demo0580999.mockable.io/soap/testGenerator"/>
|
||||
</port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class AttachmentRequest extends AttachmentType
|
||||
{
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class AttachmentType
|
||||
{
|
||||
public $fileName;
|
||||
public $binaryData;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class BookInformation
|
||||
{
|
||||
public $type;
|
||||
public $isbn;
|
||||
public $author;
|
||||
public $title;
|
||||
}
|
@ -1,89 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definitions targetNamespace="http://ws.apache.org/axis2/mtomsample/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws.apache.org/axis2/mtomsample/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
|
||||
<types>
|
||||
<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://ws.apache.org/axis2/mtomsample/" xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
<xsd:import namespace="http://www.w3.org/2005/05/xmlmime"/>
|
||||
<xsd:complexType name="AttachmentType">
|
||||
<xsd:sequence>
|
||||
<xsd:element minOccurs="0" name="fileName" type="xsd:string"/>
|
||||
<xsd:element minOccurs="0" name="binaryData" type="xmime:base64Binary"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="AttachmentRequest" type="tns:AttachmentType"/>
|
||||
<xsd:element name="AttachmentResponse" type="xsd:string"/>
|
||||
</xsd:schema>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.w3.org/2005/05/xmlmime">
|
||||
<xs:attribute name="contentType">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:minLength value="3"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="expectedContentTypes" type="xs:string"/>
|
||||
<xs:complexType name="base64Binary">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:base64Binary">
|
||||
<xs:attribute ref="xmime:contentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="hexBinary">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:hexBinary">
|
||||
<xs:attribute ref="xmime:contentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
</types>
|
||||
<message name="AttachmentResponse">
|
||||
<part name="part1" element="tns:AttachmentResponse">
|
||||
</part>
|
||||
</message>
|
||||
<message name="AttachmentRequest">
|
||||
<part name="part1" element="tns:AttachmentRequest">
|
||||
</part>
|
||||
</message>
|
||||
<portType name="MTOMServicePortType">
|
||||
<operation name="attachment">
|
||||
<input message="tns:AttachmentRequest" wsaw:Action="attachment">
|
||||
</input>
|
||||
<output message="tns:AttachmentResponse" wsaw:Action="http://schemas.xmlsoap.org/wsdl/MTOMServicePortType/AttachmentResponse">
|
||||
</output>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="MTOMServiceSOAP11Binding" type="tns:MTOMServicePortType">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="attachment">
|
||||
<soap:operation soapAction="attachment" style="document"/>
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<binding name="MTOMServiceSOAP12Binding" type="tns:MTOMServicePortType">
|
||||
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="attachment">
|
||||
<soap12:operation soapAction="attachment" style="document"/>
|
||||
<input>
|
||||
<soap12:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap12:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="MTOMSample">
|
||||
<port name="MTOMSampleSOAP12port_http" binding="tns:MTOMServiceSOAP12Binding">
|
||||
<soap12:address location="http://localhost:8081/ServerInterop/MTOMServer.php"/>
|
||||
</port>
|
||||
<port name="MTOMSampleSOAP11port_http" binding="tns:MTOMServiceSOAP11Binding">
|
||||
<soap:address location="http://localhost:8081/ServerInterop/MTOMServer.php"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
@ -1,162 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://service.besimple" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://service.besimple">
|
||||
<wsdl:documentation>BeSimpleSwaService</wsdl:documentation>
|
||||
<wsdl:types>
|
||||
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.besimple">
|
||||
<xs:complexType name="Exception">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="Exception" nillable="true" type="xs:anyType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:element name="Exception">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="Exception" nillable="true" type="ns:Exception"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="uploadFile">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="data" nillable="true" type="xs:base64Binary"/>
|
||||
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="uploadFileResponse">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="downloadFile">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="downloadFileResponse">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="data" nillable="true" type="xs:base64Binary"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="downloadFileRequest">
|
||||
<wsdl:part name="parameters" element="ns:downloadFile"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="downloadFileResponse">
|
||||
<wsdl:part name="parameters" element="ns:downloadFileResponse"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="Exception">
|
||||
<wsdl:part name="parameters" element="ns:Exception"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="uploadFileRequest">
|
||||
<wsdl:part name="parameters" element="ns:uploadFile"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="uploadFileResponse">
|
||||
<wsdl:part name="parameters" element="ns:uploadFileResponse"/>
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="BeSimpleSwaServicePortType">
|
||||
<wsdl:operation name="downloadFile">
|
||||
<wsdl:input message="ns:downloadFileRequest" wsaw:Action="urn:downloadFile"/>
|
||||
<wsdl:output message="ns:downloadFileResponse" wsaw:Action="urn:downloadFileResponse"/>
|
||||
<wsdl:fault message="ns:Exception" name="Exception" wsaw:Action="urn:downloadFileException"/>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="uploadFile">
|
||||
<wsdl:input message="ns:uploadFileRequest" wsaw:Action="urn:uploadFile"/>
|
||||
<wsdl:output message="ns:uploadFileResponse" wsaw:Action="urn:uploadFileResponse"/>
|
||||
<wsdl:fault message="ns:Exception" name="Exception" wsaw:Action="urn:uploadFileException"/>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="BeSimpleSwaServiceSoap11Binding" type="ns:BeSimpleSwaServicePortType">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
|
||||
<wsdl:operation name="downloadFile">
|
||||
<soap:operation soapAction="urn:downloadFile" style="document"/>
|
||||
<wsdl:input>
|
||||
<soap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="Exception">
|
||||
<soap:fault use="literal" name="Exception"/>
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="uploadFile">
|
||||
<soap:operation soapAction="urn:uploadFile" style="document"/>
|
||||
<wsdl:input>
|
||||
<soap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="Exception">
|
||||
<soap:fault use="literal" name="Exception"/>
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:binding name="BeSimpleSwaServiceSoap12Binding" type="ns:BeSimpleSwaServicePortType">
|
||||
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
|
||||
<wsdl:operation name="downloadFile">
|
||||
<soap12:operation soapAction="urn:downloadFile" style="document"/>
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal"/>
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="Exception">
|
||||
<soap12:fault use="literal" name="Exception"/>
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="uploadFile">
|
||||
<soap12:operation soapAction="urn:uploadFile" style="document"/>
|
||||
<wsdl:input>
|
||||
<soap12:body use="literal"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap12:body use="literal"/>
|
||||
</wsdl:output>
|
||||
<wsdl:fault name="Exception">
|
||||
<soap12:fault use="literal" name="Exception"/>
|
||||
</wsdl:fault>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:binding name="BeSimpleSwaServiceHttpBinding" type="ns:BeSimpleSwaServicePortType">
|
||||
<http:binding verb="POST"/>
|
||||
<wsdl:operation name="downloadFile">
|
||||
<http:operation location="BeSimpleSwaService/downloadFile"/>
|
||||
<wsdl:input>
|
||||
<mime:content type="text/xml" part="downloadFile"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" part="downloadFile"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="uploadFile">
|
||||
<http:operation location="BeSimpleSwaService/uploadFile"/>
|
||||
<wsdl:input>
|
||||
<mime:content type="text/xml" part="uploadFile"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<mime:content type="text/xml" part="uploadFile"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="BeSimpleSwaService">
|
||||
<wsdl:port name="BeSimpleSwaServiceHttpSoap11Endpoint" binding="ns:BeSimpleSwaServiceSoap11Binding">
|
||||
<soap:address location="http://localhost:8081/ServerInterop/SwAServer.php"/>
|
||||
</wsdl:port>
|
||||
<wsdl:port name="BeSimpleSwaServiceHttpSoap12Endpoint" binding="ns:BeSimpleSwaServiceSoap12Binding">
|
||||
<soap12:address location="http://localhost:8081/ServerInterop/SwAServer.php"/>
|
||||
</wsdl:port>
|
||||
<wsdl:port name="BeSimpleSwaServiceHttpEndpoint" binding="ns:BeSimpleSwaServiceHttpBinding">
|
||||
<http:address location="http://localhost:8081/ServerInterop/SwAServer.php"/>
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
@ -1,184 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions targetNamespace="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns:wns="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns:tns="http://ws.sosnoski.com/library/types"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
|
||||
<schema elementFormDefault="qualified"
|
||||
targetNamespace="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<import namespace="http://ws.sosnoski.com/library/types"/>
|
||||
|
||||
<element name="getBook">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="isbn" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBookResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="getBookReturn" minOccurs="0" type="tns:BookInformation"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBooksByType">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="type" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBooksByTypeResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="getBooksByTypeReturn" minOccurs="0" maxOccurs="unbounded" type="tns:BookInformation"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="addBook">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="type" type="string"/>
|
||||
<element name="isbn" type="string"/>
|
||||
<element name="author" minOccurs="0" maxOccurs="unbounded" type="string"/>
|
||||
<element name="title" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="addBookResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="addBookReturn" type="boolean"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
</schema>
|
||||
|
||||
<schema elementFormDefault="qualified"
|
||||
targetNamespace="http://ws.sosnoski.com/library/types"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<complexType name="BookInformation">
|
||||
<sequence>
|
||||
<element name="author" minOccurs="0" maxOccurs="unbounded" type="string"/>
|
||||
<element name="title" type="string"/>
|
||||
</sequence>
|
||||
<attribute name="type" use="required" type="string"/>
|
||||
<attribute name="isbn" use="required" type="string"/>
|
||||
</complexType>
|
||||
|
||||
</schema>
|
||||
|
||||
</wsdl:types>
|
||||
|
||||
<wsdl:message name="getBookRequest">
|
||||
<wsdl:part element="wns:getBook" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBookResponse">
|
||||
<wsdl:part element="wns:getBookResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBooksByTypeRequest">
|
||||
<wsdl:part element="wns:getBooksByType" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBooksByTypeResponse">
|
||||
<wsdl:part element="wns:getBooksByTypeResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="addBookRequest">
|
||||
<wsdl:part element="wns:addBook" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="addBookResponse">
|
||||
<wsdl:part element="wns:addBookResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:portType name="Library">
|
||||
|
||||
<wsdl:operation name="getBook">
|
||||
<wsdl:input message="wns:getBookRequest" name="getBookRequest"/>
|
||||
<wsdl:output message="wns:getBookResponse" name="getBookResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="getBooksByType">
|
||||
<wsdl:input message="wns:getBooksByTypeRequest" name="getBooksByTypeRequest"/>
|
||||
<wsdl:output message="wns:getBooksByTypeResponse" name="getBooksByTypeResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="addBook">
|
||||
<wsdl:input message="wns:addBookRequest" name="addBookRequest"/>
|
||||
<wsdl:output message="wns:addBookResponse" name="addBookResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
</wsdl:portType>
|
||||
|
||||
<wsdl:binding name="LibrarySoapBinding" type="wns:Library">
|
||||
|
||||
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
|
||||
<wsdl:operation name="getBook">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:getBook"/>
|
||||
|
||||
<wsdl:input name="getBookRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="getBookResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="getBooksByType">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:getBooksByType"/>
|
||||
|
||||
<wsdl:input name="getBooksByTypeRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="getBooksByTypeResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="addBook">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:addBook"/>
|
||||
|
||||
<wsdl:input name="addBookRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="addBookResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
</wsdl:binding>
|
||||
|
||||
<wsdl:service name="library-signencr">
|
||||
|
||||
<wsdl:port binding="wns:LibrarySoapBinding" name="library">
|
||||
<wsdlsoap:address location="http://localhost:8081/ServerInterop/WsSecuritySigEncServer.php"/>
|
||||
</wsdl:port>
|
||||
|
||||
</wsdl:service>
|
||||
|
||||
</wsdl:definitions>
|
@ -1,184 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wsdl:definitions targetNamespace="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns:wns="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns:tns="http://ws.sosnoski.com/library/types"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
|
||||
<schema elementFormDefault="qualified"
|
||||
targetNamespace="http://ws.sosnoski.com/library/wsdl"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<import namespace="http://ws.sosnoski.com/library/types"/>
|
||||
|
||||
<element name="getBook">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="isbn" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBookResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="getBookReturn" minOccurs="0" type="tns:BookInformation"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBooksByType">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="type" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="getBooksByTypeResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="getBooksByTypeReturn" minOccurs="0" maxOccurs="unbounded" type="tns:BookInformation"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="addBook">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="type" type="string"/>
|
||||
<element name="isbn" type="string"/>
|
||||
<element name="author" minOccurs="0" maxOccurs="unbounded" type="string"/>
|
||||
<element name="title" type="string"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="addBookResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="addBookReturn" type="boolean"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
</schema>
|
||||
|
||||
<schema elementFormDefault="qualified"
|
||||
targetNamespace="http://ws.sosnoski.com/library/types"
|
||||
xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<complexType name="BookInformation">
|
||||
<sequence>
|
||||
<element name="author" minOccurs="0" maxOccurs="unbounded" type="string"/>
|
||||
<element name="title" type="string"/>
|
||||
</sequence>
|
||||
<attribute name="type" use="required" type="string"/>
|
||||
<attribute name="isbn" use="required" type="string"/>
|
||||
</complexType>
|
||||
|
||||
</schema>
|
||||
|
||||
</wsdl:types>
|
||||
|
||||
<wsdl:message name="getBookRequest">
|
||||
<wsdl:part element="wns:getBook" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBookResponse">
|
||||
<wsdl:part element="wns:getBookResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBooksByTypeRequest">
|
||||
<wsdl:part element="wns:getBooksByType" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="getBooksByTypeResponse">
|
||||
<wsdl:part element="wns:getBooksByTypeResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="addBookRequest">
|
||||
<wsdl:part element="wns:addBook" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:message name="addBookResponse">
|
||||
<wsdl:part element="wns:addBookResponse" name="parameters"/>
|
||||
</wsdl:message>
|
||||
|
||||
<wsdl:portType name="Library">
|
||||
|
||||
<wsdl:operation name="getBook">
|
||||
<wsdl:input message="wns:getBookRequest" name="getBookRequest"/>
|
||||
<wsdl:output message="wns:getBookResponse" name="getBookResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="getBooksByType">
|
||||
<wsdl:input message="wns:getBooksByTypeRequest" name="getBooksByTypeRequest"/>
|
||||
<wsdl:output message="wns:getBooksByTypeResponse" name="getBooksByTypeResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="addBook">
|
||||
<wsdl:input message="wns:addBookRequest" name="addBookRequest"/>
|
||||
<wsdl:output message="wns:addBookResponse" name="addBookResponse"/>
|
||||
</wsdl:operation>
|
||||
|
||||
</wsdl:portType>
|
||||
|
||||
<wsdl:binding name="LibrarySoapBinding" type="wns:Library">
|
||||
|
||||
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
|
||||
<wsdl:operation name="getBook">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:getBook"/>
|
||||
|
||||
<wsdl:input name="getBookRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="getBookResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="getBooksByType">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:getBooksByType"/>
|
||||
|
||||
<wsdl:input name="getBooksByTypeRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="getBooksByTypeResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
<wsdl:operation name="addBook">
|
||||
|
||||
<wsdlsoap:operation soapAction="urn:addBook"/>
|
||||
|
||||
<wsdl:input name="addBookRequest">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
|
||||
<wsdl:output name="addBookResponse">
|
||||
<wsdlsoap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
|
||||
</wsdl:operation>
|
||||
|
||||
</wsdl:binding>
|
||||
|
||||
<wsdl:service name="library-username">
|
||||
|
||||
<wsdl:port binding="wns:LibrarySoapBinding" name="library">
|
||||
<wsdlsoap:address location="http://localhost:8081/ServerInterop/WsSecurityUserPassServer.php"/>
|
||||
</wsdl:port>
|
||||
|
||||
</wsdl:service>
|
||||
|
||||
</wsdl:definitions>
|
@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class addBook
|
||||
{
|
||||
public $type;
|
||||
public $isbn;
|
||||
public $author;
|
||||
public $title;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class addBookResponse
|
||||
{
|
||||
public $addBookReturn;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class base64Binary
|
||||
{
|
||||
public $_;
|
||||
public $contentType;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICoDCCAgkCBEnhw2IwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAk5aMRMw
|
||||
EQYDVQQIEwpXZWxsaW5ndG9uMRowGAYDVQQHExFQYXJhcGFyYXVtdSBCZWFjaDEq
|
||||
MCgGA1UEChMhU29zbm9za2kgU29mdHdhcmUgQXNzb2NpYXRlcyBMdGQuMRAwDgYD
|
||||
VQQLEwdVbmtub3duMRgwFgYDVQQDEw9EZW5uaXMgU29zbm9za2kwHhcNMDkwNDEy
|
||||
MTAzMzA2WhcNMzYwODI3MTAzMzA2WjCBljELMAkGA1UEBhMCTloxEzARBgNVBAgT
|
||||
CldlbGxpbmd0b24xGjAYBgNVBAcTEVBhcmFwYXJhdW11IEJlYWNoMSowKAYDVQQK
|
||||
EyFTb3Nub3NraSBTb2Z0d2FyZSBBc3NvY2lhdGVzIEx0ZC4xEDAOBgNVBAsTB1Vu
|
||||
a25vd24xGDAWBgNVBAMTD0Rlbm5pcyBTb3Nub3NraTCBnzANBgkqhkiG9w0BAQEF
|
||||
AAOBjQAwgYkCgYEAhOVyNK8xyxtb4DnKtU6mF9KoiFqCk7eKoLE26+9h410CtTkx
|
||||
zWAfgnR+8i+LPbdsPY+yXAo6NYpCCKolXfDLe+AG2GwnMZGrIl6+BLF3hqTmIXBF
|
||||
TLGUmC7A7uBTivaWgdH1w3hb33rASoVU67BVtQ3QQi99juZX4vU9o9pScocCAwEA
|
||||
ATANBgkqhkiG9w0BAQUFAAOBgQBMNPo1KAGbz8Jl6HGbtAcetieSJ3bEAXmv1tcj
|
||||
ysBS67AXzdu1Ac+onHh2EpzBM7kuGbw+trU+AhulooPpewIQRApXP1F0KHRDcbqW
|
||||
jwvknS6HnomN9572giLGKn2601bHiRUj35hiA8aLmMUBppIRPFFAoQ0QUBCPx+m8
|
||||
/0n33w==
|
||||
-----END CERTIFICATE-----
|
@ -1,14 +0,0 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAITlcjSvMcsbW+A5yrVOphfSqIha
|
||||
gpO3iqCxNuvvYeNdArU5Mc1gH4J0fvIviz23bD2PslwKOjWKQgiqJV3wy3vgBthsJzGRqyJevgSx
|
||||
d4ak5iFwRUyxlJguwO7gU4r2loHR9cN4W996wEqFVOuwVbUN0EIvfY7mV+L1PaPaUnKHAgMBAAEC
|
||||
gYAZ6UqtLwN8YGc3fs0hMKZ9upsViuAuwPiMgED/G3twgzAF+ZLWQkmie+hMfCyf6eV200+pVm0n
|
||||
Bz/8xH/oowxpX0Kk3szoB4vFghjU84GKUcrbhu/NRIm7l3drnfbzqhQkHDCx6n1CotI4Gs49cDWu
|
||||
4uEAuxJkEIVY553unZjZgQJBAOJVIallNKmD0iQlvtWRmRzpmYDjt9vhNY6WBTIOx6SDn9SRaoSA
|
||||
fkipQ2HXo04r78TQ674+zfZ1lRTkFG7px6ECQQCWUPHp3pSZOM1oGzJrNvNaw+MizZAZjq34npHm
|
||||
9GRquFLG7BlCaI9QNGE7pN2ryYsYCRUMaM2e4GR0tUXxVGknAkAgrxqFU9AfCqI2Bh1gyf3KZxF7
|
||||
w2axofwR8ygc6nV6FGfoUneHWubhp0/LuVAj4cRmL6Vbe8ZSaPh2Y9lviuMBAkEAicP8Q+1E4j1m
|
||||
PPEYP51oYprANOiUFmhnWEL00+jPk+QFsd03tV6hYs/vAbwzkjuwqMHCMdJoCiH8z95IEUvc5wJA
|
||||
MvLOuZdu4dmhOXg/YKsbMSPjFNEVskLQNSXqw6O2wIrpPg1NQvBBAOTbiuZj3vind4VPos1wc4vB
|
||||
QocvdUC6dA==
|
||||
-----END PRIVATE KEY-----
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class downloadFile
|
||||
{
|
||||
public $name;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class downloadFileResponse
|
||||
{
|
||||
public $data;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class getBook
|
||||
{
|
||||
public $isbn;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class getBookResponse
|
||||
{
|
||||
public $getBookReturn;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class getBooksByType
|
||||
{
|
||||
public $type;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class getBooksByTypeResponse
|
||||
{
|
||||
public $getBooksByTypeReturn;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 74 KiB |
@ -1,17 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICoDCCAgkCBEnhwzMwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAk5aMRMw
|
||||
EQYDVQQIEwpXZWxsaW5ndG9uMRowGAYDVQQHExFQYXJhcGFyYXVtdSBCZWFjaDEq
|
||||
MCgGA1UEChMhU29zbm9za2kgU29mdHdhcmUgQXNzb2NpYXRlcyBMdGQuMRAwDgYD
|
||||
VQQLEwdVbmtub3duMRgwFgYDVQQDEw9EZW5uaXMgU29zbm9za2kwHhcNMDkwNDEy
|
||||
MTAzMjE5WhcNMzYwODI3MTAzMjE5WjCBljELMAkGA1UEBhMCTloxEzARBgNVBAgT
|
||||
CldlbGxpbmd0b24xGjAYBgNVBAcTEVBhcmFwYXJhdW11IEJlYWNoMSowKAYDVQQK
|
||||
EyFTb3Nub3NraSBTb2Z0d2FyZSBBc3NvY2lhdGVzIEx0ZC4xEDAOBgNVBAsTB1Vu
|
||||
a25vd24xGDAWBgNVBAMTD0Rlbm5pcyBTb3Nub3NraTCBnzANBgkqhkiG9w0BAQEF
|
||||
AAOBjQAwgYkCgYEA1H3mjQCF9uce2jmm/Yq9kE4ytfvkp4c8G90cDfJXJvOiGQds
|
||||
p2vDZXKuCkHQ7vsBBXPNTt8J/d8ZbEwyuB9Ccz5pJqi6Ig6Y2/mEsPthDyh5SrJV
|
||||
yQ/wxUGwmfSuwdrIMnplMTq+OR9BOfT3CvjSvuy9d6BQNo4wOMkDvmZTtI8CAwEA
|
||||
ATANBgkqhkiG9w0BAQUFAAOBgQCqv4475QaqlKcN2QCZJbLVKZEX+76XLQurGkgf
|
||||
2fCgesRHjfUfOHyTTlhWQdEKTcBB2XviUyyW6I//fmKfXUIiQqvgh4LHdXRPEXDf
|
||||
Y9nr89MjyQpDlnl6AlrvSej30a9iwVRUeVk4d6gxWHMRonKBFgh+TGexxUXHtPkf
|
||||
B1Pdtg==
|
||||
-----END CERTIFICATE-----
|
@ -1,14 +0,0 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANR95o0AhfbnHto5pv2KvZBOMrX7
|
||||
5KeHPBvdHA3yVybzohkHbKdrw2VyrgpB0O77AQVzzU7fCf3fGWxMMrgfQnM+aSaouiIOmNv5hLD7
|
||||
YQ8oeUqyVckP8MVBsJn0rsHayDJ6ZTE6vjkfQTn09wr40r7svXegUDaOMDjJA75mU7SPAgMBAAEC
|
||||
gYEAmw+EvkAzggkGKpkHkt07l6J4vvQh116ILo0be9HsZzBCiaExWLr6y3z0I+gDX2ErTZ9Dotp/
|
||||
oBK9qpmwKUwmYD3ogbB2AEDtN29qQxzrJR8dD742zAY6s2SrvU+HVvNmp84UutEtMceP9LsqKX3o
|
||||
9ZwhY4GefkoJPdumYZa+hYECQQDzNgSE5+bZfWQnd+o59vWpF+ZGWegIW9aEb+O5jnb5msYtJGGx
|
||||
SJ1UWV+c/xn2xO/djXCLVh0EFjMLgr/4g45tAkEA36pbTesmnXB4m/9Q87Ljkgo1mRXGfq5na3bU
|
||||
k1FrXjxEBaumpssniyy7tT6TWiwGBIelmWCI1dv4shcQFnPBawJBAJwGDFIi3zKpQWYchJOY/bHz
|
||||
lhONu9AY8n5VtValsWehRf9RtqZfuiaRi0gRU1u+rU6JXSjWHpkvkKGSyIqqAuUCQG321q8HZtPP
|
||||
AS1JKKa4E9SwOkvKfe24l1YpdTf8trn9DUBwdR3aEdYGJz9jxZR2wnqlqlAvOvdSEAKW/izbuoMC
|
||||
QBn5SLa7Zk2e9N5bmcV9Wa1VRC8wawKu+qO/Qj4UcmTH8bSrr4/kqh2TpMxSZ99HeCDJkSK0XZME
|
||||
y+Vn2DLefIc=
|
||||
-----END PRIVATE KEY-----
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class uploadFile
|
||||
{
|
||||
public $data;
|
||||
public $name;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class uploadFileResponse
|
||||
{
|
||||
public $return;
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
require '../../../../../vendor/autoload.php';
|
||||
|
||||
use BeSimple\SoapCommon\Helper as BeSimpleSoapHelper;
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\base64Binary;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\AttachmentRequest;
|
||||
|
||||
$options = array(
|
||||
'soap_version' => SOAP_1_1,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'trace' => true, // enables use of the methods SoapClient->__getLastRequest, SoapClient->__getLastRequestHeaders, SoapClient->__getLastResponse and SoapClient->__getLastResponseHeaders
|
||||
'attachment_type' => BeSimpleSoapHelper::ATTACHMENTS_TYPE_MTOM,
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'classmap' => array(
|
||||
'base64Binary' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\base64Binary',
|
||||
'AttachmentRequest' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\AttachmentRequest',
|
||||
),
|
||||
'connection_timeout' => 1,
|
||||
);
|
||||
|
||||
$sc = new BeSimpleSoapClient('Fixtures/MTOM.wsdl', $options);
|
||||
|
||||
//var_dump($sc->__getFunctions());
|
||||
//var_dump($sc->__getTypes());
|
||||
|
||||
try {
|
||||
$b64 = new base64Binary();
|
||||
$b64->_ = 'This is a test. :)';
|
||||
$b64->contentType = 'text/plain';
|
||||
|
||||
$attachment = new AttachmentRequest();
|
||||
$attachment->fileName = 'test123.txt';
|
||||
$attachment->binaryData = $b64;
|
||||
|
||||
var_dump($sc->attachment($attachment));
|
||||
|
||||
} catch (Exception $e) {
|
||||
var_dump($e);
|
||||
}
|
||||
|
||||
// var_dump(
|
||||
// $sc->__getLastRequestHeaders(),
|
||||
// $sc->__getLastRequest(),
|
||||
// $sc->__getLastResponseHeaders(),
|
||||
// $sc->__getLastResponse()
|
||||
// );
|
@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
require '../../../../../vendor/autoload.php';
|
||||
|
||||
use BeSimple\SoapCommon\Helper as BeSimpleSoapHelper;
|
||||
use BeSimple\SoapServer\SoapServer as BeSimpleSoapServer;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
$options = array(
|
||||
'soap_version' => SOAP_1_1,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'attachment_type' => BeSimpleSoapHelper::ATTACHMENTS_TYPE_MTOM,
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'classmap' => array(
|
||||
'base64Binary' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\base64Binary',
|
||||
'AttachmentType' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\AttachmentRequest',
|
||||
),
|
||||
);
|
||||
|
||||
class Mtom
|
||||
{
|
||||
public function attachment(Fixtures\AttachmentRequest $attachment)
|
||||
{
|
||||
$b64 = $attachment->binaryData;
|
||||
|
||||
file_put_contents(__DIR__.'/'.$attachment->fileName, $b64->_);
|
||||
|
||||
return 'File saved succesfully.';
|
||||
}
|
||||
}
|
||||
|
||||
$ss = new BeSimpleSoapServer(__DIR__.'/Fixtures/MTOM.wsdl', $options);
|
||||
$ss->setClass('Mtom');
|
||||
$ss->handle();
|
@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
use BeSimple\SoapCommon\Helper as BeSimpleSoapHelper;
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\AttachmentRequest;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\AttachmentType;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\base64Binary;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\TestCase;
|
||||
|
||||
class MtomServerInteropTest extends TestCase
|
||||
{
|
||||
private $options = array(
|
||||
'soap_version' => SOAP_1_1,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'attachment_type' => BeSimpleSoapHelper::ATTACHMENTS_TYPE_MTOM,
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'classmap' => array(
|
||||
'base64Binary' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\base64Binary',
|
||||
'AttachmentRequest' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\AttachmentRequest',
|
||||
),
|
||||
'proxy_host' => false,
|
||||
);
|
||||
|
||||
public function testAttachment()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/MTOM.wsdl', $this->options);
|
||||
|
||||
$b64 = new base64Binary();
|
||||
$b64->_ = 'This is a test. :)';
|
||||
$b64->contentType = 'text/plain';
|
||||
|
||||
$attachment = new AttachmentRequest();
|
||||
$attachment->fileName = 'test123.txt';
|
||||
$attachment->binaryData = $b64;
|
||||
|
||||
$this->assertEquals('File saved succesfully.', $sc->attachment($attachment));
|
||||
|
||||
$fileCreatedByServer = __DIR__.'/'.$attachment->fileName;
|
||||
$this->assertEquals($b64->_, file_get_contents($fileCreatedByServer));
|
||||
unlink($fileCreatedByServer);
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
require '../../../../../vendor/autoload.php';
|
||||
|
||||
use BeSimple\SoapCommon\Helper as BeSimpleSoapHelper;
|
||||
use BeSimple\SoapServer\SoapServer as BeSimpleSoapServer;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFile;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFileResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFile;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFileResponse;
|
||||
|
||||
$options = array(
|
||||
'soap_version' => SOAP_1_1,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'attachment_type' => BeSimpleSoapHelper::ATTACHMENTS_TYPE_SWA,
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'classmap' => array(
|
||||
'downloadFile' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFile',
|
||||
'downloadFileResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFileResponse',
|
||||
'uploadFile' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFile',
|
||||
'uploadFileResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFileResponse',
|
||||
),
|
||||
);
|
||||
|
||||
class SwA
|
||||
{
|
||||
public function uploadFile(uploadFile $uploadFile)
|
||||
{
|
||||
file_put_contents(__DIR__.'/'.$uploadFile->name, $uploadFile->data);
|
||||
|
||||
$ufr = new uploadFileResponse();
|
||||
$ufr->return = 'File saved succesfully.';
|
||||
|
||||
return $ufr;
|
||||
}
|
||||
|
||||
public function downloadFile(downloadFile $downloadFile)
|
||||
{
|
||||
$dfr = new downloadFileResponse();
|
||||
$dfr->data = file_get_contents(__DIR__.'/'.$downloadFile->name);
|
||||
|
||||
return $dfr;
|
||||
}
|
||||
}
|
||||
|
||||
$ss = new BeSimpleSoapServer(__DIR__.'/Fixtures/SwA.wsdl', $options);
|
||||
$ss->setClass('SwA');
|
||||
$ss->handle();
|
@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
require '../../../../../vendor/autoload.php';
|
||||
|
||||
use BeSimple\SoapCommon\Helper as BeSimpleSoapHelper;
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFile;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFileResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFile;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFileResponse;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\TestCase;
|
||||
|
||||
$options = array(
|
||||
'soap_version' => SOAP_1_1,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'attachment_type' => BeSimpleSoapHelper::ATTACHMENTS_TYPE_SWA,
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'trace' => true, // enables use of the methods SoapClient->__getLastRequest, SoapClient->__getLastRequestHeaders, SoapClient->__getLastResponse and SoapClient->__getLastResponseHeaders
|
||||
'classmap' => array(
|
||||
'downloadFile' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFile',
|
||||
'downloadFileResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFileResponse',
|
||||
'uploadFile' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFile',
|
||||
'uploadFileResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFileResponse',
|
||||
),
|
||||
);
|
||||
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/SwA.wsdl', $options);
|
||||
|
||||
try {
|
||||
|
||||
$upload = new uploadFile();
|
||||
$upload->name = 'upload.txt';
|
||||
$upload->data = 'This is a test. :)';
|
||||
$result = $sc->uploadFile($upload);
|
||||
|
||||
var_dump($result);
|
||||
|
||||
$download = new downloadFile();
|
||||
$download->name = 'upload.txt';
|
||||
var_dump($sc->downloadFile($download));
|
||||
} catch (Exception $e) {
|
||||
var_dump($e);
|
||||
}
|
||||
|
||||
// var_dump(
|
||||
// $sc->__getLastRequestHeaders(),
|
||||
// $sc->__getLastRequest(),
|
||||
// $sc->__getLastResponseHeaders(),
|
||||
// $sc->__getLastResponse()
|
||||
// );
|
@ -1,68 +0,0 @@
|
||||
<?php
|
||||
|
||||
use BeSimple\SoapCommon\Helper as BeSimpleSoapHelper;
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFile;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFileResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFile;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFileResponse;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\TestCase;
|
||||
|
||||
class SwaServerInteropTest extends TestCase
|
||||
{
|
||||
private $options = array(
|
||||
'soap_version' => SOAP_1_1,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'attachment_type' => BeSimpleSoapHelper::ATTACHMENTS_TYPE_SWA,
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'classmap' => array(
|
||||
'downloadFile' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFile',
|
||||
'downloadFileResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\downloadFileResponse',
|
||||
'uploadFile' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFile',
|
||||
'uploadFileResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFileResponse',
|
||||
),
|
||||
'proxy_host' => false,
|
||||
);
|
||||
|
||||
public function testUploadDownloadText()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/SwA.wsdl', $this->options);
|
||||
|
||||
$upload = new uploadFile();
|
||||
$upload->name = 'upload.txt';
|
||||
$upload->data = 'This is a test. :)';
|
||||
$result = $sc->uploadFile($upload);
|
||||
|
||||
$this->assertEquals('File saved succesfully.', $result->return);
|
||||
|
||||
$download = new downloadFile();
|
||||
$download->name = 'upload.txt';
|
||||
$result = $sc->downloadFile($download);
|
||||
|
||||
$this->assertEquals($upload->data, $result->data);
|
||||
|
||||
unlink(__DIR__.'/../ServerInterop/'.$download->name);
|
||||
}
|
||||
|
||||
public function testUploadDownloadImage()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/SwA.wsdl', $this->options);
|
||||
|
||||
$upload = new uploadFile();
|
||||
$upload->name = 'image.jpg';
|
||||
$upload->data = file_get_contents(__DIR__.'/Fixtures/image.jpg'); // source: http://www.freeimageslive.com/galleries/light/pics/swirl3768.jpg;
|
||||
$result = $sc->uploadFile($upload);
|
||||
|
||||
$this->assertEquals('File saved succesfully.', $result->return);
|
||||
|
||||
$download = new downloadFile();
|
||||
$download->name = 'image.jpg';
|
||||
$result = $sc->downloadFile($download);
|
||||
|
||||
$this->assertEquals($upload->data, $result->data);
|
||||
|
||||
unlink(__DIR__.'/../ServerInterop/'.$download->name);
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient\Tests\ServerInterop;
|
||||
|
||||
class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.3.0', '=')) {
|
||||
$this->markTestSkipped(
|
||||
'The PHP cli webserver is not available with PHP 5.3.'
|
||||
);
|
||||
}
|
||||
|
||||
$ch = curl_init('http://localhost:8081/');
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||
curl_setopt($ch, CURLOPT_HEADER, true);
|
||||
curl_setopt($ch, CURLOPT_NOBODY, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
if (curl_exec($ch) === false) {
|
||||
$this->markTestSkipped(
|
||||
'The PHP webserver is not started on port 8081.'
|
||||
);
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
}
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
<?php
|
||||
|
||||
require '../../../../../vendor/autoload.php';
|
||||
|
||||
use ass\XmlSecurity\Key as XmlSecurityKey;
|
||||
|
||||
use BeSimple\SoapCommon\Helper as BeSimpleSoapHelper;
|
||||
use BeSimple\SoapServer\SoapServer as BeSimpleSoapServer;
|
||||
use BeSimple\SoapServer\WsSecurityFilter as BeSimpleWsSecurityFilter;
|
||||
use BeSimple\SoapCommon\WsSecurityKey as BeSimpleWsSecurityKey;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation;
|
||||
|
||||
$options = array(
|
||||
'soap_version' => SOAP_1_1,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'classmap' => array(
|
||||
'getBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook',
|
||||
'getBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse',
|
||||
'getBooksByType' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType',
|
||||
'getBooksByTypeResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse',
|
||||
'addBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook',
|
||||
'addBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse',
|
||||
'BookInformation' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation',
|
||||
),
|
||||
);
|
||||
|
||||
class WsSecuritySigEncServer
|
||||
{
|
||||
public function getBook(getBook $gb)
|
||||
{
|
||||
$bi = new BookInformation();
|
||||
$bi->isbn = $gb->isbn;
|
||||
$bi->title = 'title';
|
||||
$bi->author = 'author';
|
||||
$bi->type = 'scifi';
|
||||
|
||||
$br = new getBookResponse();
|
||||
$br->getBookReturn = $bi;
|
||||
|
||||
return $br;
|
||||
}
|
||||
|
||||
public function addBook(addBook $ab)
|
||||
{
|
||||
$abr = new addBookResponse();
|
||||
$abr->addBookReturn = true;
|
||||
|
||||
return $abr;
|
||||
}
|
||||
}
|
||||
|
||||
$ss = new BeSimpleSoapServer(__DIR__.'/Fixtures/WsSecurityUserPass.wsdl', $options);
|
||||
|
||||
$wssFilter = new BeSimpleWsSecurityFilter();
|
||||
|
||||
// user key for signature and encryption
|
||||
$securityKeyUser = new BeSimpleWsSecurityKey();
|
||||
$securityKeyUser->addPrivateKey(XmlSecurityKey::RSA_SHA1, __DIR__.'/Fixtures/serverkey.pem', true);
|
||||
$securityKeyUser->addPublicKey(XmlSecurityKey::RSA_SHA1, __DIR__.'/Fixtures/servercert.pem', true);
|
||||
$wssFilter->setUserSecurityKeyObject($securityKeyUser);
|
||||
// service key for encryption
|
||||
$securityKeyService = new BeSimpleWsSecurityKey();
|
||||
$securityKeyService->addPrivateKey(XmlSecurityKey::TRIPLEDES_CBC);
|
||||
$securityKeyService->addPublicKey(XmlSecurityKey::RSA_1_5, __DIR__.'/Fixtures/clientcert.pem', true);
|
||||
$wssFilter->setServiceSecurityKeyObject($securityKeyService);
|
||||
// TOKEN_REFERENCE_SUBJECT_KEY_IDENTIFIER | TOKEN_REFERENCE_SECURITY_TOKEN | TOKEN_REFERENCE_THUMBPRINT_SHA1
|
||||
$wssFilter->setSecurityOptionsSignature(BeSimpleWsSecurityFilter::TOKEN_REFERENCE_SECURITY_TOKEN);
|
||||
$wssFilter->setSecurityOptionsEncryption(BeSimpleWsSecurityFilter::TOKEN_REFERENCE_THUMBPRINT_SHA1);
|
||||
|
||||
$soapKernel = $ss->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
||||
$ss->setClass('WsSecuritySigEncServer');
|
||||
$ss->handle();
|
@ -1,82 +0,0 @@
|
||||
<?php
|
||||
|
||||
error_reporting(0);
|
||||
|
||||
require '../../../../../vendor/autoload.php';
|
||||
|
||||
use ass\XmlSecurity\Key as XmlSecurityKey;
|
||||
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
use BeSimple\SoapClient\WsSecurityFilter as BeSimpleWsSecurityFilter;
|
||||
use BeSimple\SoapCommon\WsSecurityKey as BeSimpleWsSecurityKey;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation;
|
||||
|
||||
$options = array(
|
||||
'soap_version' => SOAP_1_2,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'trace' => true, // enables use of the methods SoapClient->__getLastRequest, SoapClient->__getLastRequestHeaders, SoapClient->__getLastResponse and SoapClient->__getLastResponseHeaders
|
||||
'classmap' => array(
|
||||
'getBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook',
|
||||
'getBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse',
|
||||
'getBooksByType' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType',
|
||||
'getBooksByTypeResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse',
|
||||
'addBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook',
|
||||
'addBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse',
|
||||
'BookInformation' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation',
|
||||
),
|
||||
);
|
||||
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/WsSecuritySigEnc.wsdl', $options);
|
||||
|
||||
//var_dump($sc->__getFunctions());
|
||||
//var_dump($sc->__getTypes());
|
||||
|
||||
try {
|
||||
$wssFilter = new BeSimpleWsSecurityFilter();
|
||||
// user key for signature and encryption
|
||||
$securityKeyUser = new BeSimpleWsSecurityKey();
|
||||
$securityKeyUser->addPrivateKey(XmlSecurityKey::RSA_SHA1, __DIR__.'/Fixtures/clientkey.pem', true);
|
||||
$securityKeyUser->addPublicKey(XmlSecurityKey::RSA_SHA1, __DIR__.'/Fixtures/clientcert.pem', true);
|
||||
$wssFilter->setUserSecurityKeyObject($securityKeyUser);
|
||||
// service key for encryption
|
||||
$securityKeyService = new BeSimpleWsSecurityKey();
|
||||
$securityKeyService->addPrivateKey(XmlSecurityKey::TRIPLEDES_CBC);
|
||||
$securityKeyService->addPublicKey(XmlSecurityKey::RSA_1_5, __DIR__.'/Fixtures/servercert.pem', true);
|
||||
$wssFilter->setServiceSecurityKeyObject($securityKeyService);
|
||||
// TOKEN_REFERENCE_SUBJECT_KEY_IDENTIFIER | TOKEN_REFERENCE_SECURITY_TOKEN | TOKEN_REFERENCE_THUMBPRINT_SHA1
|
||||
$wssFilter->setSecurityOptionsSignature(BeSimpleWsSecurityFilter::TOKEN_REFERENCE_SECURITY_TOKEN);
|
||||
$wssFilter->setSecurityOptionsEncryption(BeSimpleWsSecurityFilter::TOKEN_REFERENCE_THUMBPRINT_SHA1);
|
||||
|
||||
$soapKernel = $sc->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
||||
$gb = new getBook();
|
||||
$gb->isbn = '0061020052';
|
||||
$result = $sc->getBook($gb);
|
||||
var_dump($result->getBookReturn);
|
||||
|
||||
$ab = new addBook();
|
||||
$ab->isbn = '0445203498';
|
||||
$ab->title = 'The Dragon Never Sleeps';
|
||||
$ab->author = 'Cook, Glen';
|
||||
$ab->type = 'scifi';
|
||||
|
||||
var_dump($sc->addBook($ab));
|
||||
|
||||
} catch (Exception $e) {
|
||||
var_dump($e);
|
||||
}
|
||||
|
||||
// var_dump(
|
||||
// $sc->__getLastRequestHeaders(),
|
||||
// $sc->__getLastRequest(),
|
||||
// $sc->__getLastResponseHeaders(),
|
||||
// $sc->__getLastResponse()
|
||||
// );
|
@ -1,73 +0,0 @@
|
||||
<?php
|
||||
|
||||
use ass\XmlSecurity\Key as XmlSecurityKey;
|
||||
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
use BeSimple\SoapClient\WsSecurityFilter as BeSimpleWsSecurityFilter;
|
||||
use BeSimple\SoapCommon\WsSecurityKey as BeSimpleWsSecurityKey;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\TestCase;
|
||||
|
||||
class WsSecuritySigEncServerInteropTest extends TestCase
|
||||
{
|
||||
private $options = array(
|
||||
'soap_version' => SOAP_1_2,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'classmap' => array(
|
||||
'getBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook',
|
||||
'getBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse',
|
||||
'getBooksByType' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType',
|
||||
'getBooksByTypeResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse',
|
||||
'addBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook',
|
||||
'addBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse',
|
||||
'BookInformation' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation',
|
||||
),
|
||||
'proxy_host' => false,
|
||||
);
|
||||
|
||||
public function testSigEnc()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/WsSecuritySigEnc.wsdl', $this->options);
|
||||
|
||||
$wssFilter = new BeSimpleWsSecurityFilter();
|
||||
// user key for signature and encryption
|
||||
$securityKeyUser = new BeSimpleWsSecurityKey();
|
||||
$securityKeyUser->addPrivateKey(XmlSecurityKey::RSA_SHA1, __DIR__.'/Fixtures/clientkey.pem', true);
|
||||
$securityKeyUser->addPublicKey(XmlSecurityKey::RSA_SHA1, __DIR__.'/Fixtures/clientcert.pem', true);
|
||||
$wssFilter->setUserSecurityKeyObject($securityKeyUser);
|
||||
// service key for encryption
|
||||
$securityKeyService = new BeSimpleWsSecurityKey();
|
||||
$securityKeyService->addPrivateKey(XmlSecurityKey::TRIPLEDES_CBC);
|
||||
$securityKeyService->addPublicKey(XmlSecurityKey::RSA_1_5, __DIR__.'/Fixtures/servercert.pem', true);
|
||||
$wssFilter->setServiceSecurityKeyObject($securityKeyService);
|
||||
// TOKEN_REFERENCE_SUBJECT_KEY_IDENTIFIER | TOKEN_REFERENCE_SECURITY_TOKEN | TOKEN_REFERENCE_THUMBPRINT_SHA1
|
||||
$wssFilter->setSecurityOptionsSignature(BeSimpleWsSecurityFilter::TOKEN_REFERENCE_SECURITY_TOKEN);
|
||||
$wssFilter->setSecurityOptionsEncryption(BeSimpleWsSecurityFilter::TOKEN_REFERENCE_THUMBPRINT_SHA1);
|
||||
|
||||
$soapKernel = $sc->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
||||
$gb = new getBook();
|
||||
$gb->isbn = '0061020052';
|
||||
$result = $sc->getBook($gb);
|
||||
$this->assertInstanceOf('BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation', $result->getBookReturn);
|
||||
|
||||
$ab = new addBook();
|
||||
$ab->isbn = '0445203498';
|
||||
$ab->title = 'The Dragon Never Sleeps';
|
||||
$ab->author = 'Cook, Glen';
|
||||
$ab->type = 'scifi';
|
||||
|
||||
$this->assertTrue((bool) $sc->addBook($ab));
|
||||
|
||||
// getBooksByType("scifi");
|
||||
}
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
<?php
|
||||
|
||||
require '../../../../../vendor/autoload.php';
|
||||
|
||||
use BeSimple\SoapCommon\Helper as BeSimpleSoapHelper;
|
||||
use BeSimple\SoapServer\SoapServer as BeSimpleSoapServer;
|
||||
use BeSimple\SoapServer\WsSecurityFilter as BeSimpleWsSecurityFilter;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation;
|
||||
|
||||
$options = array(
|
||||
'soap_version' => SOAP_1_1,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'cache_wsdl' => WSDL_CACHE_NONE,
|
||||
'classmap' => array(
|
||||
'getBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook',
|
||||
'getBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse',
|
||||
'getBooksByType' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType',
|
||||
'getBooksByTypeResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse',
|
||||
'addBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook',
|
||||
'addBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse',
|
||||
'BookInformation' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation',
|
||||
),
|
||||
);
|
||||
|
||||
class Auth
|
||||
{
|
||||
public static function usernamePasswordCallback($user)
|
||||
{
|
||||
if ($user == 'libuser') {
|
||||
return 'books';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class WsSecurityUserPassServer
|
||||
{
|
||||
public function getBook(getBook $gb)
|
||||
{
|
||||
$bi = new BookInformation();
|
||||
$bi->isbn = $gb->isbn;
|
||||
$bi->title = 'title';
|
||||
$bi->author = 'author';
|
||||
$bi->type = 'scifi';
|
||||
|
||||
$br = new getBookResponse();
|
||||
$br->getBookReturn = $bi;
|
||||
|
||||
return $br;
|
||||
}
|
||||
|
||||
public function addBook(addBook $ab)
|
||||
{
|
||||
$abr = new addBookResponse();
|
||||
$abr->addBookReturn = true;
|
||||
|
||||
return $abr;
|
||||
}
|
||||
}
|
||||
|
||||
$ss = new BeSimpleSoapServer(__DIR__.'/Fixtures/WsSecurityUserPass.wsdl', $options);
|
||||
|
||||
$wssFilter = new BeSimpleWsSecurityFilter();
|
||||
$wssFilter->setUsernamePasswordCallback(array('Auth', 'usernamePasswordCallback'));
|
||||
|
||||
$soapKernel = $ss->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
||||
$ss->setClass('WsSecurityUserPassServer');
|
||||
$ss->handle();
|
@ -1,67 +0,0 @@
|
||||
<?php
|
||||
|
||||
require '../../../../../vendor/autoload.php';
|
||||
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
use BeSimple\SoapClient\WsSecurityFilter as BeSimpleWsSecurityFilter;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\TestCase;
|
||||
|
||||
$options = array(
|
||||
'soap_version' => SOAP_1_2,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'trace' => true, // enables use of the methods SoapClient->__getLastRequest, SoapClient->__getLastRequestHeaders, SoapClient->__getLastResponse and SoapClient->__getLastResponseHeaders
|
||||
'classmap' => array(
|
||||
'getBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook',
|
||||
'getBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse',
|
||||
'getBooksByType' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType',
|
||||
'getBooksByTypeResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse',
|
||||
'addBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook',
|
||||
'addBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse',
|
||||
'BookInformation' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation',
|
||||
),
|
||||
);
|
||||
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/WsSecurityUserPass.wsdl', $options);
|
||||
|
||||
//var_dump($sc->__getFunctions());
|
||||
//var_dump($sc->__getTypes());
|
||||
|
||||
try {
|
||||
$wssFilter = new BeSimpleWsSecurityFilter(true, 600);
|
||||
$wssFilter->addUserData('libuser', 'books', BeSimpleWsSecurityFilter::PASSWORD_TYPE_DIGEST);
|
||||
|
||||
$soapKernel = $sc->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
||||
$gb = new getBook();
|
||||
$gb->isbn = '0061020052';
|
||||
$result = $sc->getBook($gb);
|
||||
var_dump($result->getBookReturn);
|
||||
|
||||
$ab = new addBook();
|
||||
$ab->isbn = '0445203498';
|
||||
$ab->title = 'The Dragon Never Sleeps';
|
||||
$ab->author = 'Cook, Glen';
|
||||
$ab->type = 'scifi';
|
||||
|
||||
var_dump($sc->addBook($ab));
|
||||
|
||||
} catch (Exception $e) {
|
||||
var_dump($e);
|
||||
}
|
||||
|
||||
// var_dump(
|
||||
// $sc->__getLastRequestHeaders(),
|
||||
// $sc->__getLastRequest(),
|
||||
// $sc->__getLastResponseHeaders(),
|
||||
// $sc->__getLastResponse()
|
||||
// );
|
@ -1,86 +0,0 @@
|
||||
<?php
|
||||
|
||||
use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
|
||||
use BeSimple\SoapClient\WsSecurityFilter as BeSimpleWsSecurityFilter;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse;
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
use BeSimple\SoapClient\Tests\ServerInterop\TestCase;
|
||||
|
||||
class WsSecurityUserPassServerInteropTest extends TestCase
|
||||
{
|
||||
private $options = array(
|
||||
'soap_version' => SOAP_1_2,
|
||||
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
|
||||
'classmap' => array(
|
||||
'getBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBook',
|
||||
'getBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBookResponse',
|
||||
'getBooksByType' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByType',
|
||||
'getBooksByTypeResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\getBooksByTypeResponse',
|
||||
'addBook' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBook',
|
||||
'addBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse',
|
||||
'BookInformation' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation',
|
||||
),
|
||||
'proxy_host' => false,
|
||||
);
|
||||
|
||||
public function testUserPassText()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/WsSecurityUserPass.wsdl', $this->options);
|
||||
|
||||
$wssFilter = new BeSimpleWsSecurityFilter(true, 600);
|
||||
$wssFilter->addUserData('libuser', 'books', BeSimpleWsSecurityFilter::PASSWORD_TYPE_TEXT);
|
||||
|
||||
$soapKernel = $sc->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
||||
$gb = new getBook();
|
||||
$gb->isbn = '0061020052';
|
||||
$result = $sc->getBook($gb);
|
||||
$this->assertInstanceOf('BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation', $result->getBookReturn);
|
||||
|
||||
$ab = new addBook();
|
||||
$ab->isbn = '0445203498';
|
||||
$ab->title = 'The Dragon Never Sleeps';
|
||||
$ab->author = 'Cook, Glen';
|
||||
$ab->type = 'scifi';
|
||||
|
||||
$this->assertTrue((bool) $sc->addBook($ab));
|
||||
|
||||
// getBooksByType("scifi");
|
||||
}
|
||||
|
||||
public function testUserPassDigest()
|
||||
{
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/WsSecurityUserPass.wsdl', $this->options);
|
||||
|
||||
$wssFilter = new BeSimpleWsSecurityFilter(true, 600);
|
||||
$wssFilter->addUserData( 'libuser', 'books', BeSimpleWsSecurityFilter::PASSWORD_TYPE_DIGEST );
|
||||
|
||||
$soapKernel = $sc->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
||||
$gb = new getBook();
|
||||
$gb->isbn = '0061020052';
|
||||
$result = $sc->getBook($gb);
|
||||
$this->assertInstanceOf('BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation', $result->getBookReturn);
|
||||
|
||||
$ab = new addBook();
|
||||
$ab->isbn = '0445203498';
|
||||
$ab->title = 'The Dragon Never Sleeps';
|
||||
$ab->author = 'Cook, Glen';
|
||||
$ab->type = 'scifi';
|
||||
|
||||
$this->assertTrue((bool) $sc->addBook($ab));
|
||||
|
||||
// getBooksByType("scifi");
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user