Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send a xml file ?

Status
Not open for further replies.

capri1966

Programmer
May 13, 2010
57
ES
Hello, i want to send a xml file generated with my app, and i would like to know how to send this file to a specific website
automatically and wait for response . How i can do this with VFP ?.
 
Let me hijack this, as I had an error, that fooled me for the last three business days.

It all started out with MSXML2.XMLHTTP and then I also tried the older MICROSFT.XMLHTTP, more recent MSXML2.XMLHTTP.6.0, MSXML2.XMLHTTP.3.0, and finally also MSXML2.SERVERXMLHTTP.

And they all errored on the OPEN method, and not only that, I don't need to swear by anything, I have a coverage log recording, even just CREATEOBJECT() of some of these classes caused OLE errors.

As a contribution to your question, Capri, you see you even have a variety of classes available to use for POST, besides what you describe sounds like wanting to use a Soap based Web API and there is the outdated Soap Toolkit for that, but also look at
----------

OK, back to my hijacking of this topic, I had used all these variants within a COM Server, and as this happened even on CREATEOBJECT() it all looked like a compromised system needing a repair installation, yet it turned out if you open a URL like https:/google.com with a slash missing in all these OLE classes error without a good error message.

I can only explain the failed CREATEOBJECTs with a flaky situation, a flaky state of the libraries after a lot usgaes of OPEN() with invalid URLs. The funny part is how I got to such URLs. Just a typo? No, that would be too easy.
I did this to compose the URLs:

Code:
LOCAL lcBaseURL, lcRequestURL, lcURL
lcBaseURL = Alltrim(This.cBaseURL) && "THIS" being something like goApp.oWebAPI
lcRequestURL = Alltrim(SOME_REQUEST_URL) && coming from #DEFINEs in a header file
lcURL = STRTRAN(lcBaseURL+lcRequestURL,"//","/") && bad idea, really bad idea.

The thought behind that is I wanted to avoid the case when a BaseURL (coming from configuration metadata) ends in a slash and the request URL starts in a slash, you don't get a wrong double slash within the combined URL. And, bummer, I didn't think of the double slash in the Well, let's forget I also used AddBS first, while that's only a good function for base paths, but not base URLs.

It was all buried in a COM Server not as easy to debug, I did coverage logging and error logging, but didn't log URLs and values of requests, that would have revealed it. Or, as I see now, using WinHttp.WinHttpRequest.5.1, as that is giving a sensible error message when you feed it with such a wrong URL.

So thanks, Mike Gagnon. It's a good reminder of winhttp.dll.

Bye, Olaf.
Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top