Board index » cppbuilder » Calling a web-service from behind a proxy server

Calling a web-service from behind a proxy server


2006-05-20 03:30:27 AM
cppbuilder28
BCB6 patched.
I have had one developer tell me that my application that calls a
web-service should "just work" from behind a proxy server. Is this true?
I am suspicous of this because I have had one client tell me that my "check
for updates" functionality fails because they are behind an *authenticating*
proxy server. As far as that goes I have modified that check for updates
code to be like this:
if (globalOptions.UseProxy)
{
IdHTTP1->Request->ProxyServer = globalOptions.ProxyName;
IdHTTP1->Request->ProxyPort = globalOptions.ProxyPort;
if (globalOptions.UseProxyAuth)
{
IdHTTP1->Request->ProxyUsername = globalOptions.ProxyUserName;
IdHTTP1->Request->ProxyPassword = globalOptions.ProxyPassword;
}
}
AnsiString response = IdHTTP1->Get(fullURL);
I believe that will work - but not sure because I havent set up the
necessary proxy server to test.
Now, as far as the web-service goes, I could do something similar - but the
import BCB creates uses THTTPRIO to invoke the service and it does not have
such proxy server details.
What do you think I should do?
TIA.
M.
 
 

Re:Calling a web-service from behind a proxy server

"Borland Lover" < XXXX@XXXXX.COM >wrote in message
Quote
I have had one developer tell me that my application that calls a
web-service should "just work" from behind a proxy server. Is this true?
Only if the application's code takes the proxy into account. Otherwise no.
Quote
if (globalOptions.UseProxy)
{
IdHTTP1->Request->ProxyServer = globalOptions.ProxyName;
IdHTTP1->Request->ProxyPort = globalOptions.ProxyPort;

if (globalOptions.UseProxyAuth)
{
IdHTTP1->Request->ProxyUsername = globalOptions.ProxyUserName;
IdHTTP1->Request->ProxyPassword = globalOptions.ProxyPassword;
}
}
You need to use the ProxyParams property instead, ie:
IdHTTP1->ProxyParams->Clear;
if (globalOptions.UseProxy)
{
IdHTTP1->ProxyParams->ProxyServer = globalOptions.ProxyName;
IdHTTP1->ProxyParams->ProxyPort = globalOptions.ProxyPort;
if (globalOptions.UseProxyAuth)
{
IdHTTP1->ProxyParams->ProxyUsername =
globalOptions.ProxyUserName;
IdHTTP1->ProxyParams->ProxyPassword =
globalOptions.ProxyPassword;
}
}
Gambit
 

Re:Calling a web-service from behind a proxy server

"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote
[...]
Quote
You need to use the ProxyParams property instead, ie:
IdHTTP1->ProxyParams->Clear;
[...]
TIdHTTP in my version (BCB6) does not contain a "ProxyParams" property.
Is there an update I should have?
 

{smallsort}

Re:Calling a web-service from behind a proxy server

"Borland Lover" < XXXX@XXXXX.COM >wrote in message
Quote
TIdHTTP in my version (BCB6) does not contain a
"ProxyParams" property.
BCB 6 ships with Indy 8, which is no longer supported. You need to upgrade
to Indy 9 or 10.
Gambit