Web Connection
HttpSendRequest fail
Gravatar is a globally recognized avatar based on your email address. HttpSendRequest fail
  Jamie Osborn
  All
  Aug 20, 2017 @ 05:00pm

I am encountering an issue whereby wwhttp:HttpGet() is failing when an VFP exe is run (on a 2012 server) but succeeds when the same exe is run from within the VFP IDE on that same machine. This exe is running in an RDP session.

Tracing in I can see that the actual API failing is the HttpSendRequest(). The GetLastError() is returning 12029.

The HttpOpenRequest() succeeds and returns a handle before the call to HttpSendRequest() which fails with that handle.

Does anyone have any idea as to why the exe would work within VFP IDE (DO myexe.exe) but fail when then exe is run outside.

This same exe runs on Windows 7 & 10 machines with no issues.

Gravatar is a globally recognized avatar based on your email address. re: HttpSendRequest fail
  Rick Strahl
  Jamie Osborn
  Aug 22, 2017 @ 09:54am

My guess is you have some firewall issues. You probably have allowed VFP.exe access to your HTTP ports but other applications (your custom exe) may not have those same rights. While you're in that RDP session see if you can shut down the firewall temporarily and see if the request goes trhough - if that's it you can tweak the Firewall rules to make sure your app is allowed through.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: HttpSendRequest fail
  Jamie Osborn
  Jamie Osborn
  Aug 23, 2017 @ 06:40pm

Thanks for the reply Rick.

It turned out to be an issue with where the EXE was being run from. It appears the RDS didn't like the exe being run from a share on a certain server - it let it run but the http stuff failed. When we were running from VFP we were running it from a share on a different server.

I need to learn to isolate the variables when fault finding!

Cheers, Jamie

© 1996-2024