问题描述:

I'm trying to get product API details from the database using PHP.

<?php

class Data {

private $db;

public function __construct(){

$this->db = new soapclient('http://api.3dcart.com/cart_advanced.asmx?WSDL',array('trace'=>1,'soap_version'=>SOAP_1_1));

}

public function query($sql){

$param = array(

'storeUrl'=>"[URL]",

'userKey'=>"[KEY]",

'sqlStatement'=>$sql

);

$result = $this->db->runQuery($param);

$match = $result->runQueryResult->any;

$sxe = new SimpleXMLElement($match);

return $sxe->runQueryRecord;

}

}

$db = new Data();

$query = $db->query("SELECT * FROM product WHERE catalogid = 1");

var_dump($query);

?>

After running this program, I got this

<Error xmlns="">Error trying to get data from the store. Technical description: First request failed.This feature is disabled in demo mode. --- request params: storeURL=XXXXXXXXXXXX.3dcart.net, Method=runQuery, UserKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, UserIp=49.207.181.148, CallbackUrl=, sqlStatement=SELECT+*+FROM+product+WHERE+catalogid+%3d+1</Error>object(SimpleXMLElement)#6 (0) {

}

Really I don't know that how to get product list using PHP. If anyone knows please suggest me how to get product list.

网友答案:

The api you are using is in Demo mode, the error message tells you that the feature is switched off: "This feature is disabled in demo mode".

Find a way to get out of the Demo mode, probably contacting the support of 3dcart.com is a good starting point. I checked out their website and didn't find the reason why it is in demo mode.

相关阅读:
Top