是否可以在維護HTTP會話的同時從Oracle服務雲發送自定義XML消息?來自使用PHP代碼的服務雲的HTTP會話
到目前爲止,我已經成功使用捲曲發送一條消息:
<?php
use \Rightnow\Connect\v1_2 as RNCPHP;
use \Rightnow\CPM\v1 as RNCPM;
$url1 = "";
$startInterviewHeaders = array("SOAPAction: http://oracle");
$startInterview;
// session
//$strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/';
if(!function_exists("\curl_init")){
\load_curl();
echo "curl loaded";
} else {
echo "curl already exists ";
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIE, $strCookie);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_URL, $url1);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POSTFIELDS, $startInterview);
curl_setopt($ch, CURLOPT_HTTPHEADER, $startInterviewHeaders);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$startInterviewresponse = curl_exec($ch);
//echo $response;
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curl_errno= curl_errno($ch);
echo "</br> HTTP status: " . $http_status . "</br> cURL error: " .$curl_errno . "</br>";
curl_close($ch); // close cURL
echo $startInterviewresponse;
?>
編輯:上面的代碼發送一個消息,得到響應,但是當我試圖保持與CURLOPT_COOKIEJAR HTTP會話和CURLOPT_COOKIEFILE,第二個cURL消息響應抱怨沒有活動會話。我用於維護會話
sessions.com.oracle.determinations.server.exceptions.NoActiveInterviewExceptionaction "Investigate" can not be performed without an active interview
代碼
curl_setopt($ch,CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie-name'); //could be empty, but cause problems on some hosts
curl_setopt($ch, CURLOPT_COOKIEFILE, '/var/www/ip4.x/file/tmp'); //could be empty, but cause problems
感謝(RightNow的環境之外進行測試時,工作)!
定義「崩潰」。你會得到什麼錯誤,輸出或結果。 – drew010
在rightnow-crm的土地上,這是一個通用的錯誤,沒有說什麼。在玩了一段時間後,我很確定我不允許在crm中創建任何臨時文件。有沒有解決辦法?我可以將會話存儲在變量中嗎? – Ward