Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Simon Cropper
  Where is Simon Cropper?
 Melbourne
 Australia
 Simon Cropper
 To: Madan Mohan_DELHI
  Where is Madan Mohan_DELHI?
 Delhi
 India
 Madan Mohan_DELHI
 Tags
Subject: RE: WebServices - Need Help
Thread ID: 345346 Message ID: 345391 # Views: 57 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Web Services
Date: Wednesday, May 23, 2012 5:49:26 AM         
   


> 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

Sanjay,

Your program is accessing SOAP. Check out MSDN for details of its use http://msdn.microsoft.com/en-us/library/ms995800.aspx

Also it appears that most of the parameters for accessing the web are stored in a table called tname.

"tempuri.org" is probably a dummy URL stored in your system so the data can be validated. Where this is hidden is dependent on your operating system (e.g. XP, Vista, etc).

Good luck.

Simon Cropper

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