try {
// Replace the following variables with your own key management
// $APPLICATION_KEY
// $APPLICATION_ID
$appId = $APPLICATION_ID;
$appKey = $APPLICATION_KEY;
$publicServiceUrl = 'https://api.tradera.com/v3/PublicService.asmx';
$publicServiceUrlWithAuth = $publicServiceUrl
. '?appId=' . $appId
. '&appKey=' . $appKey;
$publicClient = new SoapClient(
$publicServiceUrl . '?WSDL',
array('location' => $publicServiceUrlWithAuth)
);
// Make Soap call
$getItemFieldValuesResponse = $publicClient->GetItemFieldValues();
$result = $getItemFieldValuesResponse -> GetItemFieldValuesResult;
// Handle result
echo 'VAT:' . PHP_EOL;
foreach ($result -> VAT as $vat) {
echo '' . $vat . PHP_EOL;
}
echo 'Item attributes:' . PHP_EOL;
foreach ($result -> ItemAttributes as $itemAttr) {
echo 'Id: ' . $itemAttr -> Id . ' Description: ' . $itemAttr -> Description . PHP_EOL;
}
echo 'Payment types:' . PHP_EOL;
foreach ($result -> PaymentTypes as $payType) {
echo 'Id: ' . $payType -> Id . ' Description: ' . $payType -> Description . PHP_EOL;
}
echo 'Shipping types:' . PHP_EOL;
foreach ($result -> ShippingTypes as $shipType) {
echo 'Id: ' . $shipType -> Id . ' Description: ' . $shipType -> Description . PHP_EOL;
}
}
catch(SoapFault $soapFault) {
echo 'Error: ' . $soapFault->faultstring;
}
|