Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send recordset to server
Message
From
27/08/1999 10:55:15
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00258288
Message ID:
00258424
Views:
9
>Hi Erik,
>
>Thanks for the info (Craig and Alex too)
>
>>IMHO, XML is the way to go here. If you can easily translate a recordset to XML, and easily transform that XML back into a recordset, what's the problem?
>
>There's no problem, I'd like to start with the best possible solution. Therefore I'd like to hear/read some opinions.
>
>>Your mode of transfer (FTP, HTTP Post, SMTP) is really a separate question- but one lends itself better to client-server transaction, and that's HTTP requests- loading your document into a POST variable and then calling a server method through its URL is the way to go, because you can get an immediate response with your success status.
>
>I'm new to these things. Could you show/send me an example of an XML file being transferred to the server using HTTP Requests?

You have a to have a web server set up to do this, and some sort of web software set up to take requests. This could be ASP, West Wind Web Connection, a VFP dll running through FoxISAPI, or any other server code. If you are not familiar with any of these, I suggest you go to West-wind.com and read some of Rick's articles about the various web technologies available to you as a VFP programmer.

Once you have a server taking requests, posting the request is just a few lines of code, and can be done with several tools, but my favorite is wwIPStuff. If I were challenged with your task, my client side code would go something like this:

SELECT * FROM Mytable Where SomeCondition = .T. INTO MyCursor

oIP = CREATEOBJECT("wwIPStuff")
oXML = CREATEOBJECT("wwXML")

lcXML = oXML.CursorToXML()
.HTTPConnect(THISFORM.MACServerAddress)

WITH oIP
.HTTPConnect("www.MyServer.Com")
.AddPostKey("XMLVar",lcXML)
lcBuffer = ""
lnResult = .HTTPGetEx("/serverscripts/somepage.asp",@lcBuffer)
ENDWITH

The above code does the following:

1. Create a cursor from an SQL SELECT
2. Create an instance of West Wind's XML object
3. Create an instance of West Wind's wwIPStuff
4. Use the XML objecty to create an XML document from the current cursor, and store the document in lcXML
5. Use wwIPStuff to "Connect" to my webserver using HTTPConnect
6. Add a POST variable called "XMLVar" (arbitrary) that contains the XML document I just created
7. Send the request to Somepage.asp using HTTPGetEx.

lcBuffer will contain the contents of the results.

Rick's website has a great article on HTTP apps on his website.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform