1. global $stores;
  2.            
  3.             $xmlStores = new SimpleXMLElement($stores);
  4.            
  5.             foreach($xmlStores as $store) {
  6.  
  7.                     if ($store->id == STORE_ID){
  8.                         $storeWebAddress = $store->webaddress."/volantews/api";
  9.                         $storeWebAddressPort = $store->port;
  10.                     }
  11.                    
  12.             }
  13.    
  14.             $ch = curl_init($storeWebAddress);
  15.             curl_setopt( $ch, CURLOPT_POST, 1 );
  16.             //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  17.             //curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  18.             curl_setopt( $ch, CURLOPT_POSTFIELDS, $xmlRequest );
  19.             curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
  20.             curl_setopt( $ch, CURLOPT_TIMEOUT, 240 );
  21.             curl_setopt($ch, CURLOPT_PORT, $storeWebAddressPort);
  22.             $xmlResponse = curl_exec( $ch );            
  23.             curl_close($ch);
  24.            
  25.            
  26.             if($xmlResponse) {
  27.                 return $xmlResponse;
  28.             }
  29.             else{
  30.                 $conf['type'] = "Content-Type:text/html";
  31.                 return "err";
  32.             }