PHP code example of aaharu / curlsoapclient

1. Go to this page and download the library: Download aaharu/curlsoapclient library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aaharu / curlsoapclient example snippets


public CurlSoapClient::CurlSoapClient ( mixed $wsdl [, array $options ] )

use Aaharu\Soap\CurlSoapClient;

try {
    $client = new CurlSoapClient('http://webservices.amazon.com/AWSECommerceService/2013-08-01/AWSECommerceService.wsdl', ['trace' => true]);
    $client->ItemLookup();
} catch (\SoapFault $fault) {
}

echo $client->__getLastRequestHeaders() . $client->__getLastRequest();

use Aaharu\Soap\CurlSoapClient;

$client = new CurlSoapClient(null, [
    'location' => 'http://example.com/test/location',
    'uri' => 'http://example.com/test/uri',
    'redirect_max' => 1,
    'exceptions' => false,
]);
$client->doSomething();

POST /onca/soap?Service=AWSECommerceService HTTP/1.1
Host: webservices.amazon.com
Accept: */*
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://soap.amazon.com/ItemLookup"
Content-Length: 259

<?xml version="1.0" encoding="UTF-8"