SoapClient.php
<?php
// Source: https://www.php.net/manual/en/class.soapclient.php#102503
class exampleChannelAdvisorAuth {
public $developerKey;
public $password;
public function __construct($key, $pass) {
$this->developerKey = $key;
$this->password = $pass;
}
}
$devKey = '';
$password = '';
$accountId = '';
$url = '';
$client = new SoapClient($url, ['trace' => 1, 'exception' => 0]);
$auth = new ChannelAdvisorAuth($devKey, $password);
$header = new SoapHeader('http://www.example.com/webservices/', 'APICredentials', $auth, $false);
$result = $client->__soapCall('DeleteMarketplaceAd', [
'DeleteMarketplaceAd' => [
'accountID' => $accountId,
'marketplaceAdID' => '9938745',
]
], null, $header);
echo '<pre>';
var_dump($result);
echo '</pre>';
if($result->DeleteMarketplaceAdResult->Status == 'Success') {
echo 'Item deleted!';
}