Guys,
right now i am posting xml to a service running on certain port.
my sample code is
Quote:
$XPost = fread($handle, filesize($xmlfile));
fclose($handle);
$ch = curl_init(); // initialize curl handle
curl_setopt($ch, CURLOPT_VERBOSE, 1); // set url to post to
curl_setopt($ch, CURLOPT_URL, $URL); // set url to post to
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10000);
curl_setopt($ch, CURLOPT_POSTFIELDS, $XPost); // add POST fields
curl_setopt($ch, CURLOPT_POST, 1);
$result = curl_exec($ch);
my problem is some time xml data is ignored .Is this anything related to CURLOPT_TIMEOUT option?what is the prefered value? Anyother solution to optimize the code will be helpful.
note:I will call this function say 50 times 30 times data is correctly loading.sometimes ignored.