public static function createSoapclient() { ini_set("soap.wsdl_cache_enabled", "0"); $vtex_params_soap = Config::get('vtex_params_soap'); $vtex_params_proxy = Config::get('vtex_params_proxy'); $vtex_params_proxy = Config::get('development') === true ? $vtex_params_proxy['development'] : $vtex_params_proxy['production']; self::$client = new SoapClient($vtex_params_soap['url_wsdl'], array('login' => $vtex_params_soap['login'], 'password' => $vtex_params_soap['password'], 'proxy_host' => $vtex_params_proxy['proxy_host'], 'proxy_port' => $vtex_params_proxy['proxy_port'], 'trace' => 1)); self::$client->__setLocation($vtex_params_soap['url_location']); return self::$client; }
private function StockKeepingUnitServiceInsertUpdate() { try { $soapClient = VtexSoap::createSoapclient(); $result = $soapClient->StockKeepingUnitServiceInsertUpdate($this); if (is_object($result) and property_exists($result, 'StockKeepingUnitServiceInsertUpdateResult')) { return (is_object($result->StockKeepingUnitServiceInsertUpdateResult) and property_exists($result->StockKeepingUnitServiceInsertUpdateResult, 'Id')) ? $result->StockKeepingUnitServiceInsertUpdateResult : NULL; } return NULL; } catch (SoapFault $e) { VtexSoap::setResponseHeader($soapClient); $message = "Falha no processo de Integração. Método: " . __METHOD__; $messageVtex = json_encode(array('message' => $e->getMessage())); Handler::error($message, $messageVtex); } }
private function StockKeepingUnitImageRemove() { try { $soapClient = VtexSoap::createSoapclient(); $result = $soapClient->StockKeepingUnitImageRemove($this); return is_object($result) ? true : false; } catch (SoapFault $e) { VtexSoap::setResponseHeader($soapClient); $message = "Falha no processo de Integração. Método: " . __METHOD__; $messageVtex = json_encode(array('message' => $e->getMessage())); Handler::error($message, $messageVtex); } }
private function active($data) { $this->populate($data); try { $soapClient = VtexSoap::createSoapclient(); $result = $soapClient->StockKeepingUnitActive(array('idStockKeepingUnit' => $this->idStockKeepingUnit)); if (is_object($result)) { $message = 'Flag Ativar Sku se possível ativada com sucesso'; Handler::success($message, json_encode(array("result" => "true"))); } else { $message = 'Flag Ativar Sku se possível não foi ativada'; Handler::error($message, json_encode(array("result" => "false"))); } } catch (SoapFault $e) { VtexSoap::setResponseHeader($soapClient); $message = "Falha no processo de Integração. Método: " . __METHOD__; $messageVtex = json_encode(array('message' => $e->getMessage())); Handler::error($message, $messageVtex); } }