Делаю клиентскую часть к вебсервису.
Импортировала WSDL, получила интерфейс вебсервиса AuthenticationServiceSoap.
AuthenticationServiceSoap = interface(IInvokable)
['']
function AutoLogin: Boolean; stdcall;
function Login(const username: WideString; const password: WideString; const clientVersion: WideString): UserInfo; stdcall;
function Logout: Boolean; stdcall;
end;
function GetAuthenticationServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): AuthenticationServiceSoap;
implementation
function GetAuthenticationServiceSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): AuthenticationServiceSoap;
const
defWSDL = 'D:\xml\ASV.Services.AuthenticationService.xml';
defURL = 'http://.../csp/asv/ASV.Services.AuthenticationService.cls';
defSvc = 'AuthenticationService';
defPrt = 'AuthenticationServiceSoap';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as AuthenticationServiceSoap);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;
Вызываю GetAuthenticationServiceSoap:
a:=GetAuthenticationServiceSoap;
a.Login('<username>','<pwd>','1.1');
На вызове Login получаю ошибку "The security token could not be authenticated or authorized". (В качестве ip, username и pwd стоят правильные данные, здесь я их убрала). Что я делаю не так?