[DUG] web service
Leigh Wanstead
leighw at softtech.co.nz
Wed Sep 14 14:31:47 NZST 2005
Hello everyone,
After some diy, here is the code.
var
varHTTPRIO: THTTPRIO;
begin
varHTTPRIO := THTTPRIO.Create(nil);
varHTTPRIO.HTTPWebNode.UserName := 'xxx';
varHTTPRIO.HTTPWebNode.Password := 'xxx';
try
GetOrderWS(False, 'http://' + TEST_WEB_SERVICE_SERVER + '/' +
TEST_WEB_SERVICE_APPLICATION + '/' + TEST_WEB_SERVICE_URL,
varHTTPRIO).createOrder('');
except
on E: ERemotableException do
begin
end;
end;
end;
Regards
Leigh
-----Original Message-----
From: delphi-bounces at ns3.123.co.nz
[mailto:delphi-bounces at ns3.123.co.nz]On Behalf Of Leigh Wanstead
Sent: Wednesday, 14 September 2005 1:48 p.m.
To: Rohit Gupta; delphi at ns3.123.co.nz
Subject: RE: [DUG] web service
Hi Rohit,
Is it possible to do following code like .net but in Delphi?
NetworkCredential cred = new NetworkCredential(aUserName, aPassword);
webService.Credentials = cred;
TIA
Regards
Leigh
-----Original Message-----
From: Rohit Gupta [mailto:r.gupta at xtra.co.nz]
Sent: Wednesday, 14 September 2005 1:31 p.m.
To: leighw at softtech.co.nz; NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] web service
When you design the webservice end, you build in the username and
password to each function as its a stateless beast. So your call will
be hello (username, password,arguments). And you handle the username
and password yourself.
If you are talking about the initial access to the webservice, that is
controlled by the IIS (etc) running on that server. That is, its a
windows access issue. Either you use Certificates to control access or
you open selected ports fully or you have windows login.
Leigh Wanstead wrote:
>Hello everyone,
>
>I use THTTPRIO and here is the test code.
>
>var
> varHTTPRIO: THTTPRIO;
>begin
> varHTTPRIO := THTTPRIO.Create(nil);
> try
> varHTTPRIO.URL := 'http://localhost/Service';
> (varHTTPRIO as ServiceWS).hello('');
> finally
> FreeAndNil(varHTTPRIO);
> end;
>end;
>
>May I ask how to supply user name and password without bring Windows login
>dialog?
>
>TIA
>
>Regards
>Leigh
>
>
>_______________________________________________
>Delphi mailing list
>Delphi at ns3.123.co.nz
>http://ns3.123.co.nz/mailman/listinfo/delphi
>
>
>
_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi
More information about the Delphi
mailing list