USS-Connect APICatalogue list

languageCode = 'de'; $environment->countryCode = 'DE'; $environment->portalName = 'print24'; $messageLevel = 'all'; // build the webservice client // test server, access with sample certificate. Download this from the Unitedprint api download page. $soap_service = "http://interface.onts.unitedprint.dev/wsdl2.1/catalogue.wsdl"; // real server, you need your own certificate. Contact the Unitedprint customers service. // $soap_service = "http://interface.unitedprint.com/wsdl2.1"; try { $options = array( 'soap_version' => SOAP_1_1, 'exceptions' => true, 'trace' => 1, 'cache_wsdl' => WSDL_CACHE_NONE, 'local_cert' => 'sample.cert', 'stream_context' => stream_context_create(['ssl' => ['verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true]]), 'charset' => 'utf8', ); $client = new SoapClient($soap_service, $options); } catch(Exception $e) { echo "Error on make interface client: " . $e->getMessage(); } $catalogueIdentCode = ''; $changeItem = FALSE; $changeArgs = new setCustomProductRequestType(); $changeArgs->environment = $environment; $changeArgs->messageLevel = $messageLevel; $itemToChange = 0; foreach($_GET as $key => $value) { switch ($key){ case 'getItem': $getItem = $_GET['getItem']; break; case 'catalogueIdentCode': $catalogueIdentCode = $_GET['catalogueIdentCode']; break; case 'deleteItem': $changeArgs->writeMode = 'deactivate'; $changeArgs->product = new selectedType(); $changeArgs->product->internalId = $value; $changeItem = TRUE; break; case 'editItem': $itemToChange = $value; echo ""; break; case 'renameItem': $changeArgs->writeMode = 'rename'; $changeArgs->product = new selectedType(); $changeArgs->product->internalId = $value; $changeArgs->product->itemIdentifier = $_GET{'itemIdentifier'}; $changeItem = TRUE; break; default: break; } } if ($changeItem){ // change item try { $erg = $client->setCustomProduct($changeArgs); }catch(Exception $e) { echo "Error on request setCustomerProduct: " . $e->getMessage(); } $changeItem = FALSE; } try { // get product list $getListArgs = new getCatalogueListRequestType(); $getListArgs->environment = $environment; $getListArgs->messageLevel = $messageLevel; $selection = new catalogueSelectionType(); $getListArgs->selection = $selection; $getListArgs->selection->catalogueIdentCode = $catalogueIdentCode; $getListArgs->selection->type = ''; $getListArgs->selection->limitFrom = 0; $getListArgs->selection->limitCount = 100; $list = $client->getCatalogueList($getListArgs); } catch(Exception $e) { echo "Error on request getCatalogueList: " . $e->getMessage(); } echo "

party group: " . $list->environment->partyGroupName . " / " . $list->environment->portalName . " / " . $list->environment->countryCode . "_" . $list->environment->languageCode ."

\n"; if (isset($getItem)){ // get one product try { $getItemArgs = new getCustomProductRequestType(); $getItemArgs->environment = $environment; $getItemArgs->messageLevel = $messageLevel; $selection = new catalogueSelectionType(); $getItemArgs->selection = $selection; $getItemArgs->selection->itemIdentifier = $getItem; $prod = $client->getCustomProduct($getItemArgs); } catch(Exception $e) { echo "Error on request getCustomProduct: " . $e->getMessage(); } } echo "
"; if ( isset($prod) && property_exists($prod, 'product') ) { echo "

".$prod->product->itemIdentifier."

"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
product group".$prod->product->productNameSingular."
internal id".$prod->product->internalId."
product price net/gross".$prod->product->priceNet ."/".$prod->product->priceGross ." ".$prod->environment->currencyCode ."
shipping price net/gross".$prod->product->shippingNet ."/".$prod->product->shippingGross ." ".$prod->environment->currencyCode ."
delivery".$prod->product->delivery."

properties

"; echo ""; foreach ($prod->product->propertyNames as $property) { echo ""; } echo "
".$property->name."".utf8_decode($property->value)."
"; } ?>
catalogue, 'catalogueList')){ if (gettype($list->catalogue->catalogueList) != 'array'){ // change oobject in array first $list->catalogue->catalogueList = array($list->catalogue->catalogueList); } $n = 0; foreach ($list->catalogue->catalogueList as $item) { if ($itemToChange == $item->internalId){ echo "" .""; } else { echo "" ."" .""; } } } ?>
".++$n."" ."" ."" ."
".++$n."" .$item->productId."" ."" ."" ."