Gönderdiğin XML çıktısını ekler misin konuya? Gönderim yaparken API bilgilerin gidiyor mu?
Api bilgilerini kontrol ettim her hangi bir sorun görünmüyor. Tam olarak kullandığım kod aşağıdadır.
abc.php
Class N11 {
protected static $_appKey, $_appSecret, $_parameters, $_sclient;
public $_debug = false;
public function __construct(array $attributes = array()) {
self::$_appKey = $attributes['appKey'];
self::$_appSecret = $attributes['appSecret'];
self::$_parameters = ['auth' => ['appKey' => self::$_appKey, 'appSecret' => self::$_appSecret]];
}
public function setUrl($url) {
self::$_sclient = new \SoapClient($url);
}
//Stok Güncelleme
public function UpdateStockByStockSellerCode($products = array())
{
$this->setUrl('https://api.n11.com/ws/ProductStockService.wsdl');
self::$_parameters['stockItems']['stockItem']['sellerStockCode'] = "Stok Kodu";
self::$_parameters['stockItems']['stockItem']['quantity'] = "5";
self::$_parameters['stockItems']['stockItem']['version'] = "";
$result[] = self::$_sclient->UpdateStockByStockSellerCode(self::$_parameters);
return $result;
}
public function __destruct() {
if ($this->_debug) {
print_r(self::$_parameters);
}
}
}guncelle.php
require_once ('abc.php');
$n11Params = [
'appKey' => 'xxxx',
'appSecret' => 'xxx',
];
$n11 = new N11($n11Params);
$productList = $n11->UpdateStockByStockSellerCode();
print_r($productList);