I'm having a problem access the MICROSOFT.XMLHTTP object for a program I'm writing. I need to post information to a website and return the data. Below is my code:
CREATE "Microsoft.XMLHTTP" hOutputHTTPS NO-ERROR.
hOutputHTTPS:OPEN('POST', vURL,FALSE).
hOutputHTTPS:setRequestheader("Data-Content-Length", STRING(LENGTH(vOutputRec))).
hOutputHTTPS:setRequestheader("Data-Data", vOutputRec).
hOutputHTTPS:setRequestheader("Data-Length", STRING(LENGTH(vOutputRec))).
PROBLEM HERE
hOutputHTTPS:SEND("post=" + string(TODAY) + STRING(TIME)).
PROBLEM HERE
vReceivedLength=hOutputHTTPS:getResponseHeader("DrugPlan-Content-Length").
vReceivedRec=hOutputHTTPS:getResponseHeader("DrugPlan-Data").
ASSIGN
vWebstatus = hOutputHTTPS:STATUS.
RELEASE OBJECT hOutputHTTPS.
The problem is that the first time I run this code, the object correctly prompts me to pick a certificate. I pick the correct one for the site and then.... nothing.. It spins off in silence for about 2 minutes until I get the error message:
Error occurred while accessing component property/method: SEND.
The download the specified resource has failed.
Error code: 0x800200009 doTransaction comm/send.p
However if I then try re-running the code again in the program by pushing a button, it WILL succceed. Just the first time the https call doesn't seem to work. All subsequent calls are fast, efficient and exactly what I need. However my customer won't stand for a 2 minute error on the first transaction. ;-). Any ideas what I'm doing wrong or what I can do to fix this?
-Todd
CREATE "Microsoft.XMLHTTP" hOutputHTTPS NO-ERROR.
hOutputHTTPS:OPEN('POST', vURL,FALSE).
hOutputHTTPS:setRequestheader("Data-Content-Length", STRING(LENGTH(vOutputRec))).
hOutputHTTPS:setRequestheader("Data-Data", vOutputRec).
hOutputHTTPS:setRequestheader("Data-Length", STRING(LENGTH(vOutputRec))).
PROBLEM HERE
hOutputHTTPS:SEND("post=" + string(TODAY) + STRING(TIME)).
PROBLEM HERE
vReceivedLength=hOutputHTTPS:getResponseHeader("DrugPlan-Content-Length").
vReceivedRec=hOutputHTTPS:getResponseHeader("DrugPlan-Data").
ASSIGN
vWebstatus = hOutputHTTPS:STATUS.
RELEASE OBJECT hOutputHTTPS.
The problem is that the first time I run this code, the object correctly prompts me to pick a certificate. I pick the correct one for the site and then.... nothing.. It spins off in silence for about 2 minutes until I get the error message:
Error occurred while accessing component property/method: SEND.
The download the specified resource has failed.
Error code: 0x800200009 doTransaction comm/send.p
However if I then try re-running the code again in the program by pushing a button, it WILL succceed. Just the first time the https call doesn't seem to work. All subsequent calls are fast, efficient and exactly what I need. However my customer won't stand for a 2 minute error on the first transaction. ;-). Any ideas what I'm doing wrong or what I can do to fix this?
-Todd