Exemplo n.º 1
0
 function __doRequest($request, $location, $saction, $version, $one_way = null)
 {
     $doc = new DOMDocument();
     $doc->loadXML($request);
     $objWSSE = new WSSESoap($doc);
     $objWSSE->addUserToken("*", "*", FALSE);
     $objWSSE->addOAuth($this->getInternalAuthToken($this->tenantKey));
     $content = utf8_encode($objWSSE->saveXML());
     $content_length = strlen($content);
     if ($this->debugSOAP) {
         error_log('FuelSDK SOAP Request: ');
         error_log(str_replace($this->getInternalAuthToken($this->tenantKey), "REMOVED", $content));
     }
     $headers = array("Content-Type: text/xml", "SOAPAction: " . $saction, "User-Agent: " . getSDKVersion());
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $location);
     curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($ch, CURLOPT_USERAGENT, "FuelSDK-PHP-v0.9");
     $output = curl_exec($ch);
     $this->lastHTTPCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     curl_close($ch);
     return $output;
 }