Hi,
Actually my problem is that When i make a CURL request to a back-end server running under Tomcat, I get the response(xml) and that's fine, but on my 2nd, 3rd and subsequent requests the CURL response (xml) is the same, where it shouldn't be.
For testing this problem I made a same request to the BE Tomcat server manually through the Browser (i.e. without CURL) and there it works fine. That is the back-end server returns modified results on each subsequent request. My subsequest requests just changing the sorting criteria attribute in the URL and on the basis of which tomcat is returning different results.
So could anybody pls help me in solving this problem.
thanks.
CURL Returns Stale Results
Moderator: General Moderators
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Code: Select all
// init curl
$churl = curl_init();
//CURLOPT_HEADER
curl_setopt($churl, CURLOPT_HTTPHEADER, $this->m_header);
curl_setopt($churl, CURLOPT_HEADER, TRUE);
// set URL
curl_setopt($churl, CURLOPT_URL, $this->m_requestUrl);
// Write result to variable
curl_setopt($churl, CURLOPT_RETURNTRANSFER, TRUE);
// Set timeout
if ($this->m_timeout)
{
curl_setopt($churl, CURLOPT_TIMEOUT, $this->m_timeout);
//curl_setopt($churl, CURLOPT_TIMEOUT, 3);
}
// set Proxy
if ($this->m_curlProxy)
{
curl_setopt($churl, CURLOPT_PROXY, $this->m_curlProxy);
}
//curl_setopt($churl, CURLOPT_FRESH_CONNECT, TRUE);
//curl_setopt($churl, CURLOPT_CONNECTTIMEOUT, 0);
// write content in $doc
$response = curl_exec($churl);
// close connection
curl_close($churl);Code: Select all
URL: http://slycl1158.st1.spray.net:8080/travelsearch10/SearchGateway?command=getResults&startIndex=1&noOfRecords=0&sortBy=1
URL: http://slycl1158.st1.spray.net:8080/travelsearch10/SearchGateway?command=getResults&startIndex=1&noOfRecords=0&sortBy=2
..3, 4feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]No I'm sorry that was just a null value. I have just commented it but still the problem is the same.
No Proxy ..
No Proxy ..
Code: Select all
// // set Proxy
// if ($this->m_curlProxy)
// {
// curl_setopt($churl, CURLOPT_PROXY, $this->m_curlProxy);
// }