Hello everyone, I have a web service that call getActiveCoupons function which has to return extracted data from database table oxvouchers.
So, I have file oxws.php where a function is defined and oxws_article.php where the function is called.
But, I am not able to return an array with extracted data from oxvouchers, because I am receiving following error: Error: Service has no operation ‘getActiveCoupons’.
Any Help?
oxws.php
/**
- SOAP call to get Active Coupon Codes for products
- @param string $oxid OXID to get Coupon
-
@return array
*/
function getActiveCoupons($start){
$Coupon = __autoload(‘oxws_articles’);
$Coupons = $Coupon->getActiveCoupons($oxid);
return $Coupons;
}
$server->register(
‘getActiveCoupons’,
array(‘oxid’=>‘xsd:int’),
array(‘return’ => ‘tns:ActiveCoupons’),
API_NAMESPACE,
false, false, false
);
oxws_articles.php
/**
* Function to find Active Coupons
*
*
* @return array
*/
public function getActiveCoupons($start)
{
$columns='oxvouchernr, oxvoucherserieid, oxid';
$this->myConfig = $this->getConfig();
$this->oDb = $this->getDb();
$cQuery = "select".$columns." from oxvouchers";
return $this->oDb->getArray($cQuery);
}