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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP, XML-RPC to Web API 1

Status
Not open for further replies.

robbino

IS-IT--Management
May 13, 2002
3
GB
Hi,
I am trying to get access to this Websites API's:

(test API method)

I have read many articles on using SOAP and VFP, but this site does not support SOAP (as far as I can see).

The site requires XML files to be sent via XML-RPC. Can anyone point me in the right direction of how to send XML files via XML-RPC in VFP.

Rob
 
Nobody's answered and I'm afraid I can't help either. I had had a similar problem last year and couldn't get VFP to work with the Web Service. In the end I wrote a C# component to talk to the web service and then pass the XML back to Fox.

Geoff Franklin
 
See if this helps you out a little. I tried the URL but all I get back is the entire page. I have used this method with my own xml services in the past without problem

Code:
sURL = [[URL unfurl="true"]http://www.fotolia.com/Services/API/Method/test[/URL]]
sXML = [<?xml version="1.0" encoding="utf-8"?><methodCall><methodName>xmlrpc.test</methodName><params><param>]
sXML = sXML + [<value><string>YOUR_API_KEY</string></value></param></params></methodCall>]

loHTTP = CREATEOBJECT("WinHttp.WinHttpRequest.5.1")	
loHTTP.Open("POST", sURL, .F.)		
loHTTP.SetRequestHeader([content-type], [text/xml;charset=utf-8])	
loHTTP.Send(STRCONV(sXML , 9)) 
STRTOFILE(lohttp.ResponseText, 'test.txt')
 
Thanks rkolva, that worked a treat (I had the wrong URL for the API)

cheers

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top