Failure to run consecutive http post requests.

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Failure to run consecutive http post requests.

Post by tommytx » Mon Dec 22, 2003 3:39 am

I am trying to query a .asp file hooked to a data base and am using the following line which works great once but when repeated locks the macro and must ctrl alt delete out of it. Then sometimes the computer must be restarted.

Here is line1 of the script:

Let>PostData=State=va&StartRecordID=1
HTTPRequest>http://www.firstpreston.com/broker_stat ... MLResponse
Wait>10
Let>PostData=State=va&StartRecordID=26
HTTPRequest>http://www.firstpreston.com/broker_stat ... MLResponse
Wait>10
Let>PostData=State=va&StartRecordID=51
HTTPRequest>http://www.firstpreston.com/broker_stat ... MLResponse

All of the Let commands have been tested individually and they all work when only one section is entered, however when you try to run 2 in a row it locks up.

Is there some reset command that needs to be given before sending the second post command?

I have tried Wait up to 30 seconds and it makes no difference. I am using high speed internet and it only takes a second to save each file when done individually.

I also tried WaitWindowOpen>Status*
However I don't think that can work cause since I am saving direct I don't believe I am opening any window.

Does anyone know what command I can use to ensure the file is saved before I command a new file download with the next post command.

However the wait is not the problem, simply the lock up between each load.

The actual website that the script is querring is given here if anyone wants to test any idea that they may have. Each sequential post should download a file of about 20k bytes and the title of each page begins with Status ... each page has same name.

I will forever be in anyone's debt who can help me with this.

Thanks
Tom

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Dec 22, 2003 4:15 am

Hi Tom:

:?: Can you pronounce indentured? :D
I will forever be in anyone's debt who can help me with this.


Your code:
Let>PostData=State=va&StartRecordID=1
HTTPRequest>http://www.firstpreston.com/broker_stat ... :\resh_wsh\preston.htm,POST,PostData,HTMLResponse
Wait>10
Let>PostData=State=va&StartRecordID=26
HTTPRequest>http://www.firstpreston.com/broker_stat ... :\resh_wsh\preston1.htm,POST,PostData,HTMLResponse
Wait>10
Let>PostData=State=va&StartRecordID=51
HTTPRequest>http://www.firstpreston.com/broker_stat ... :\resh_wsh\preston1.htm,POST,PostData,HTMLResponse
What is happening is that the third routine has the same name as the second, so it is overwriting the file that was already downloaded.

If you think that timing is an issue you could add a line to check to see if the file exists, or if the size>0. If not, then loop until file is confirmed, then continue to next step.

But the problem is the naming.

The following script worked fine:
Let>PostData=State=va&StartRecordID=1
HTTPRequest>http://www.firstpreston.com/broker_stat ... :\resh_wsh\preston1.htm,POST,PostData,HTMLResponse
Wait>10
Let>PostData=State=va&StartRecordID=26
HTTPRequest>http://www.firstpreston.com/broker_stat ... :\resh_wsh\preston2.htm,POST,PostData,HTMLResponse
Wait>10
Let>PostData=State=va&StartRecordID=51
HTTPRequest>http://www.firstpreston.com/broker_stat ... :\resh_wsh\preston3.htm,POST,PostData,HTMLResponse
There is a delay while files are downloaded, but it does not appear to be preventing the process from happening. I made a log and the commands appear to wait for completion of the previous download.

Ahhh, now I can retire, when can I expect that check? Daily would be preferred, but I guess I can live with a weekly one instead. :D
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Post by tommytx » Mon Dec 22, 2003 4:47 am

Thanks Bob, for the quick response, as I really do need to get this thing going. However, I copied your input from the screen and dumped it into my macro player and same results, I wonder if it is my operating system. I am running XP and we all know how finicky the xp can be.

The name was a typo, as I had only been testing post 1 and 2 but to make sure anyone viewing it could see the pattern, I simply copied post 2 and pasted it and forgot to change the number 2 to number 3. I had never run the one with 3 posts.

However, the first one always download quickly in about 1 second and I even tried deleting the previous download to make sure that was not the problem.

Once I start the program, I can count 1001, 1002 etc for 10 seconds and the litttle gear at the bottom (macro icon in tray) blinks once each second for a count of 10. At that point it immediately freezes (stops blinking) and the computer is completely locked up and requires a warm boot to get control back. At this point. the only file downloaded is the first one on the list. None of the other posts even get run due to lockup.

Several times I have completed a full shutdown and restart just to make sure everything is set right. No luck with anything I try.

If no one comes up with a solution soon. I will try to move it off the XP and onto a 98 for trial. By chance is yours an XP...that would eliminate that idea.

I have tried reversing the posts, that is place #2 first and #1 second and that makes no difference, the first one comes in quick then after the 10 second wait complete lockup. However when file #2 is first it will downlaod ok then there is no download on #1 or #3.

Anyway thanks a lot for the help .... any other ideas...and no I am not saying this just to get out of indenturism.

This is important and I hope I can solve it soon.

Thanks for your help Bob! Does anyone else have any other ideas?

Your almost servant,

Tom

tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Post by tommytx » Mon Dec 22, 2003 5:30 am

This may be a support question, as I just tried the below using the get vice the post and got the same results...that is a lock up after the first file is downloaded. there needs to be a reset command to get it ready for the next post or get command.

It will lock up if you just do one and it works ok. Then a little later you activate that program again. It will still be locked up from doing just the one perevious post and will not even do one download now untlil the computer is restarted.

Maybe Support will see this one and pick up on it. I hope..I hope....

HTTPRequest>http://www.vahud.com,c:\resh_wsh\vahud1.htm,GET,,HTMLResponse
Wait>10
HTTPRequest>http://www.vahud.com,c:\resh_wsh\vahud2.htm,GET,,HTMLResponse
Wait>10
HTTPRequest>http://www.vahud.com,c:\resh_wsh\vahud3.htm,GET,,HTMLResponse


Thanks for any advice from anyone.

Tom

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Dec 22, 2003 5:39 am

I copied your input from the screen and dumped it into my macro player and same results
Be advised that doing cut and paste, especially from the forum may end up with blank spaces at the end of a line. These trailing spaces can be a problem in Macro Scheduler, it is very literal.
In the Macro Schedule Editor, be sure to turn on Edit, Show all chars, and click on Edit, Remove Trailing Spaces.

Here is the log from my WIN98SE system, total time was 3 seconds after negating the Wait> commands. With the Wait> commands it did take 23 seconds, as expected.
12/22/2003 00:27:05:190 - Started Macro : Temp
12/22/2003 00:27:05:240 - Let>PostData=State=va&StartRecordID=1
12/22/2003 00:27:05:240 - HTTPRequest>http://www.firstpreston.com/broker_stat ... MLResponse
12/22/2003 00:27:06:390 - //Wait>10
12/22/2003 00:27:06:450 - Let>PostData=State=va&StartRecordID=26
12/22/2003 00:27:06:450 - HTTPRequest>http://www.firstpreston.com/broker_stat ... MLResponse
12/22/2003 00:27:07:490 - //Wait>10
12/22/2003 00:27:07:490 - Let>PostData=State=va&StartRecordID=51
12/22/2003 00:27:07:550 - HTTPRequest>http://www.firstpreston.com/broker_stat ... MLResponse
12/22/2003 00:27:08:320 -
12/22/2003 00:27:08:370 - Finished Macro : Temp
And I just ran it on an XP Professional system. Same results, log here:
12/22/2003 00:34:10:765 - Started Macro : Temp
12/22/2003 00:34:10:781 - Let>PostData=State=va&StartRecordID=1
12/22/2003 00:34:11:562 - HTTPRequest>http://www.firstpreston.com/broker_stat ... MLResponse
12/22/2003 00:34:11:593 - //Wait>10
12/22/2003 00:34:11:609 - Let>PostData=State=va&StartRecordID=26
12/22/2003 00:34:12:328 - HTTPRequest>http://www.firstpreston.com/broker_stat ... MLResponse
12/22/2003 00:34:12:359 - //Wait>10
12/22/2003 00:34:12:375 - Let>PostData=State=va&StartRecordID=51
12/22/2003 00:34:13:093 - HTTPRequest>http://www.firstpreston.com/broker_stat ... MLResponse
12/22/2003 00:34:13:125 -
12/22/2003 00:34:13:140 - Finished Macro : Temp
Try turning your system off for at least three minutes and restarting. Sometimes a simple reboot can do wonders with Microsoft OS. But cold start is better than a warm reboot. Certainly can't hurt, can it?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Post by tommytx » Mon Dec 22, 2003 3:00 pm

Hey Bob,

Thanks for all your help but no solution yet.

I had previously turned off the computer several times with negative results. Cold reboot.

I also checked for end space as you suggested and had none. However I did then place spaces at the end of each line and it ran fine thru the first 2 lines same as before, but when ready to command Http it locks on the second try everytime.

Since it works on your XP, maybe I will try to set it up on another computer to see if it just don't like my computer.

I also ran it in debug and it steps thru each of the first 2 steps just fine and activates the http command just great. Then activates the next line for setting the variables ok but locks on the next http command.

Here is something interesting..(confusing) If I only activate the first 2 lines ... that is delete all others, it runs fine and appears be ok cause I can actually run other scripts at this time.
Now if you try to activate any script with the http get or post immediate lockup occurs and will not even run it once with out shut down and restart. I can load a second copy of the macro while this one is locked and it will run the 1st two lines ok....but only once. The second copy of the macro will lock up if you try to run http commands of any sort. Sort of like I need to issue a close command which there is none that I am aware of before calling any sort of http command again.

I even went so far as to shutdown my hi speed, and connect with dialup with the exact same results.

I really appreciate your help and if anyone else has seen this or has ideas it would be greatly appreciated.

Thanks
Tom

tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Post by tommytx » Mon Dec 22, 2003 3:19 pm

Success!
I switched to a windows 98 computer and it worked just great.

However I still don't have a solution and my XP I believe has all the upgrades that are out.

It just won't run on my XP.

If anyone has any ideas, please let me know. Maybe I will send this to support to see if they can help or have any ideas as many other computers may be affected.

Thanks for all you help Bob... if you think of anything that may be affecting my XP please let me know, as I really need to run it on my XP

Thanks
Tom

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Dec 22, 2003 10:12 pm

Can only add that Service Pack 1a is installed. Using wireless network connection to local machine with cable modem connection vs. dialup.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Guest

Post by Guest » Wed Dec 24, 2003 12:55 am

Bob.
I went to http://www.windowsupdate.microsoft.com and ran the check for required updates and Service pack 1a did not show up as needed.

I don't know how to see if I have it, but microsoft did not ID it as one that I don't have.

I don't know it this matters or not, but it does down load the preston1.htm file ok as long as I don't try to activate a second download for preston2.htm and if fails the same way whether I use high speed or regular dialup.

Tom

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts