🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
4 messages
4 total messages Started by Borland Lover Fri, 19 May 2006 19:30
Calling a web-service from behind a proxy server
#612
Author: Borland Lover
Date: Fri, 19 May 2006 19:30
34 lines
2014 bytes
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
#613
Author: Remy Lebeau (TeamB)
Date: Fri, 19 May 2006 20:34
41 lines
2063 bytes
"Borland Lover" <kdhf@kbdf.com> wrote in message
news:446e1cd9$1@newsgroups.borland.com...

> 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.

> 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
#614
Author: Borland Lover
Date: Fri, 19 May 2006 21:52
9 lines
1360 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote
[...]
> 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?
Re: Calling a web-service from behind a proxy server
#615
Author: Remy Lebeau (TeamB)
Date: Fri, 19 May 2006 22:19
12 lines
1196 bytes
"Borland Lover" <kdhf@kbdf.com> wrote in message
news:446e3e2e@newsgroups.borland.com...

> 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads