global $stores;
$xmlStores = new SimpleXMLElement($stores);
foreach($xmlStores as $store) {
if ($store->id == STORE_ID){
$storeWebAddress = $store->webaddress."/volantews/api";
$storeWebAddressPort = $store->port;
}
}
$ch = curl_init($storeWebAddress);
curl_setopt( $ch, CURLOPT_POST, 1 );
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $xmlRequest );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_TIMEOUT, 240 );
curl_setopt($ch, CURLOPT_PORT, $storeWebAddressPort);
$xmlResponse = curl_exec( $ch );
curl_close($ch);
if($xmlResponse) {
return $xmlResponse;
}
else{
$conf['type'] = "Content-Type:text/html";
return "err";
}