>>>>I am trying to retrieve data from Citylink Couriers web site - most of the time the information is returned quickly but every now and then the objHTTP.Send() times out with an error
>>>>
>>>>Any idea of the best way to give the system more time or to force a repeat search on the error
>>>>
>>>>select logix
>>>>scan
>>>>partaa=ALLTRIM(logix.cityref)
>>>>parta="
http://www.city-link.co.uk/pod/xmltracking.php?jobno="
>>>>partb="&custno=318951&x1=AAA11AAA07KRFAHWS7654321AAAAAAAAAAAA="
>>>>url=parta+partaa+partb
>>>>
>>>>url=STRTRAN(url,'"',"")
>>>>url=ALLTRIM(url)
>>>>
>>>>objHTTP = CreateObject("MSXML2.XMLHTTP.4.0")
>>>>objHTTP.Open("GET", url,.f.)
>>>>objHTTP.Send()
>>>>Insert into WebPage (myMails) VALUES (objHTTP.ResponseText)
>>>>objHTTP = null
>>>>RELEASE objHTTP
>>>>etc
>>>>
>>>>endscan
>>>
>>>
>>>What version of VFP?
>>>
>>>If you can use TRY CATCH, maybe ...
>>>
>>>
>>>for (int i = 0; i < 5; i++){
>>>try {
>>> objHTTP.Send();
>>> String response = objHTTP.ResponseText;
>>> break;
>>>}
>>>catch (Exception e){
>>> //probably log this, just for your own info
>>>}
>>>}
>>>
>>>
>>>Uhhhh, looks like I used Java there. But you should get the picture.
>>
>>Thanks - I am logging the rejections and if I put them in a web browser as a string I get a valid response - I just need to give it more time on an time out
>
>
>You might be missing the FOR loop around the TRY... CATCH.
>
>If this times out, it will simply TRY again (up to 5 times, you don't want to be stuck in an infinite loop if something's wrong with the server).
getting errors with this one - I think Viv has what I am after but thanks for all your help
Specialist in Advertising, Marketing, especially Direct Marketing
I run courses in Business Management and Marketing