Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


How to send a xml file ?

How to send a xml file ?

How to send a xml file ?

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 ?.

RE: How to send a xml file ?

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 https://www.west-wind.com/wsdlgenerator/


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 https://, 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:


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 https://. 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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close