Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unclear XMLHttp behavior
Message
From
24/05/2014 04:43:33
 
 
To
23/05/2014 11:08:25
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01600581
Message ID:
01600635
Views:
47
Have you listened to the netwok traffic in the working case ?
First step I'd try in such a case...



>I have an application that verifies data by calling an HTML page from a third party, and that HTML page returns a JSON string which I parse.
>
>I have had the IT folks open the firewall to access the site, let's call it THESITE.HTML.
>
>Then I do this:
>
>local oxml ,   oAuto, oJson, lcJson
>lcKey =   ...(whole bunch of code I cannot show that creates the string to be passed)
>lcOpen = ...(URL I cannot show you)
>oXml = CREATEOBJECT("Microsoft.XMLHTTP")
>oXml.OPEN( "POST", lcOpen, .F.)			&& false sets to synchronous, returns only after call completes
>oXml.SEND()
>
>IF oXML.statustext <> "OK" 
>	=MESSAGEBOX("Cannot process "+CHR(13)+"Error: "+oxml.statustext,16,"VIN")
>	RETURN
>ENDIF
>IF "SERVER_ERROR" $ oxml.responsetext
> . . .some error code
>ENDIF
>
>oJson=NEWOBJECT("json","json.prg")
>* have to fix a couple things the parses does not like, although perfectly valid
>* json
>* #1, using [] for empty values
>lcJson = oxml.responsetext
>lcJson = STRTRAN(lcJson, "[]", '""')
>* #2 our parses does not like the [ or ] characters, also valid but not needed
>lcJson = STRTRAN(lcJson, "[", "")
>lcJson = STRTRAN(lcJson, "]", "")
>
>oAuto=oJson.parse(lcJson)
>
>&& . . . update some values
>
>thisform.Refresh
>
>
>
>Now the problem: I always receive an OK 200 connect but get an internal server error message from the web site, UNLESS I have opened a browser and previously gone to the SAME exact URL with the SAME exact string. Once I have done that, I could close the browser and my code works fine. But since there are about 1000 lookups a day, that is not a great plan <s>.
>
>XMLHttp is supposed to work with the machines WINET stack and use the same HTTP call as a browser, but something is off here.
>
>What am I missing?
>
>TIA
Previous
Reply
Map
View

Click here to load this message in the networking platform