Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Madan Mohan_DELHI
  Where is Madan Mohan_DELHI?
 Delhi
 India
 Madan Mohan_DELHI
 Tags
Subject: WebServices - Need Help
Thread ID: 345346 Message ID: 345346 # Views: 61 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Web Services
Date: Tuesday, May 22, 2012 7:14:16 PM         
   


Friends,

I have come across a piece of code in one of the program file
and I need to understand and I am not good in Web Services.

I request you if you could help me, thanks for your time.

** Establish connection
#DEFINE HTTPREQUEST_PROXYSETTING_DEFAULT 0
#DEFINE HTTPREQUEST_PROXYSETTING_PRECONFIG 0
#DEFINE HTTPREQUEST_PROXYSETTING_DIRECT 1
#DEFINE HTTPREQUEST_PROXYSETTING_PROXY 2
#DEFINE HTTPREQUEST_SETCREDENTIALS_FOR_SERVER 0
#DEFINE HTTPREQUEST_SETCREDENTIALS_FOR_PROXY 1

LOCAL oHTTP,lcUrl,lcVerb,lcProxyServer,lcUserName,lcPassword,lcSTR,lcuwaid,llDataresult,lcInfomessage,lcErrormsg

lcURL = ALLTRIM(nameofurl)
lcVerb = "POST"
lcProxyServer = ALLTRIM(tname.myproxy)+":"+ALLTRIM(tname.myport)
lcUserName = ALLTRIM(tname.proxyuid)
lcPassword = ALLTRIM(tname.proxypw)

oHTTP = CREATEOBJECT("WinHTTP.WinHTTPRequest.5.1")

IF NOT ALLTRIM(lcProxyServer) = ":" && set proxy credentials only if proxy settings available
oHTTP.SetProxy(HTTPREQUEST_PROXYSETTING_PROXY, lcProxyServer)
ENDIF

oHTTP.SetTimeouts(120000, 120000, 120000, 120000*4)

oHTTP.Open(lcVerb, lcURL) && open http request

oHTTP.setRequestHeader([Content-Type],[application/soap+xml;charset=utf-8]) && set Http Headers

IF NOT ALLTRIM(lcProxyServer) = ":" && set proxy credentials only if proxy settings available
oHTTP.SetCredentials(lcUserName, lcPassword, HTTPREQUEST_SETCREDENTIALS_FOR_PROXY)
ENDIF

lcSoapAction = 'VALIDATEAPISDATA'
lcSoapMethod =''
lcSoapMethod = lcSoapMethod + ''+lcstr+''
lcSoapMethod = lcSoapMethod + '
'

Can you please interpret this code line by line. What is the name of the webservice used in this code? What is tempuri.org?

I am almost failed to interpret this code. More or like its a matter my job now. Please help me.

Regards,
Sanjay

ENTIRE THREAD

WebServices - Need Help Posted by Madan Mohan_DELHI @ 5/22/2012 7:14:16 PM
RE: WebServices - Need Help Posted by Simon Cropper @ 5/23/2012 5:49:26 AM