Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Http vs https problem
Message
From
30/10/2007 17:03:36
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
To
30/10/2007 14:13:12
Howard Brown
Howard J. Brown Consulting Services Inc.
North Kingstown, Rhode Island, United States
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
01190517
Message ID:
01265194
Views:
36
>Hi Mike,
>was browsing UT and came across your posts.
>I have zero VFP/Internet programming experience (use ws-ftp for all data transfers), am running vfp6.0 on win2000 SP4, and need to do a simple HTTPS POST of a string or a text file with a read of the return value.
>
>winHTTP.dll is on my machine. Can you point me in the direction of a tutorial or sample code to make this happen?
>TIA
>Howie

Hi Howie,

Don't know if this will be what you need to get started: http://fox.wikis.com/wc.dll?Wiki~XMLHTTP~VFP

Here is some sample code that I've used for my particular situation. It was after many trial and error attempts.
LOCAL oHTTP AS "Microsoft.XMLHTTP"
oHTTP = CREATEOBJECT("Microsoft.XMLHTTP")
oHTTP.OPEN("POST", "http://someURLgoeshere.asmx?wsdl", .F.)
oHTTP.SetRequestHeader("content-type", "text/xml; charset=utf-8")

* Build a search request string.
strXML = ;
[<?xml version="1.0" encoding="UTF-8"?>] + ;
[<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">] + ;
	[<S:Body>] + ;
		[<ns2:SomeMethod xmlns:ns2="http://someWebService">] + ;
			[<userCredentials>] + ;
			[<username>] + THIS.cUserName + [</username>] + ;
			[<password>] + THIS.cPassword + [</password>] + ;
			[</userCredentials>] + ;
			[<searchCriteria>] + ;
				[<modifiedDateFrom>] + STR(YEAR(dStart),4)+"-"+PADL(MONTH(dStart),2,"0")+"-"+PADL(DAY(dStart),2,"0") + [</modifiedDateFrom>] + ;
				[<modifiedDateTo>] + STR(YEAR(dEnd),4)+"-"+PADL(MONTH(dEnd),2,"0")+"-"+PADL(DAY(dEnd),2,"0") + [</modifiedDateTo>] + ;
			[</searchCriteria>] + ;
		[</ns2:SomeMethod>] + ;
	[</S:Body>] + ;
[</S:Envelope>]

oHTTP.SEND(strXML)
loXML=oHTTP.responseXML.selectsinglenode("S:Envelope").selectsinglenode("S:Body").childnodes.item(0)
oHTTP = NULL
If you need any assistance for your specific case I can try to give you a hand.

Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform