PDA

View Full Version : HTTP, AMS5, another question


sferguson
11-14-2003, 10:35 AM
I have a javascript function which calls an .asp and submits a form. I have been trying to get this to work through AMS5 with the HTTP class, with no luck. Someone who has more experience with HTTP in general may be able to offer guidance to a relative newbie. Let me start with even a more simple example:

I can paste the following URL into my browser, which works great. (It won't work for you because you have to log into the system first, but you get the idea.) Here it is:

http://66.88.18.69/rbweb/reporter/RT_M01_S03.asp?jobno=94648&comtype=1

Here's my AMS5 code, which I assume should be doing the same thing:

tabAuth = {Username="XXXXX", Password="XXXXX"};

errPing = HTTP.TestConnection("http://66.88.18.69/rbweb/reporter/RT_M01_S03.asp", 20, 80, tabAuth, nil);

result = HTTP.Submit("http://66.88.18.69/rbweb/reporter/RT_M01_S03.asp", {jobno="94648", comtype="1"}, SUBMITWEB_POST, 20, 80, tabAuth, nil);

The test connection is coming back successful, but I'm getting Error 2527 ("Failed to submit to Web - Error code returned by server.") when running the submit. Is there something I'm missing? Any help much appreciated.

Colin
11-14-2003, 10:42 AM
Is it possible the problem lies in the fact that you have to "log in" to the server first? You may need to rework that so your authorization is passed along with your submit. You can't rely on things like cookies and browser state if you're using direct HTTP calls. I could be wrong here, but...

sferguson
11-14-2003, 11:15 AM
Colin-

Check the HTTP.Submit code example that I sent. I'm using tabAuth as the authentication in this code, is this not in effect "logging in"? This does give me an idea of something to try, so I appreciate the post. Any further ideas would be most appreciated.