Delphi XE 6 - запрос SOAP Ошибка HTTPRIO: система не может найти указанный файл
В строке ShowMessage(aServer.mc_version)
этого кода появляется ошибка:
uses mantisconnect;
procedure TForm.Button1Click(Sender: TObject);
var
aServer: MantisConnectPortType;
begin
aServer := GetMantisConnectPortType;
ShowMessage('Mantis version:' + aServer.mc_version);
end;
Тот же код работает на Delphi XE5, но скомпилированный на Delphi XE6 запускает ошибку в первый раз (сначала нажмите кнопку), но он работает в следующий раз:
The system cannot find the file specified
URL:http://www.mymantis.com/api/soap/mantisconnect.php -
SOAPAction: URL:http://www.mymantis.com/api/soap/mantisconnect.php/mc_version
если я попробую снова (второй щелчок на кнопке), он работает!! Выход:
Mantis version:1.2.9
Список процедуры подключения
function GetMantisConnectPortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): MantisConnectPortType;
const
defWSDL = 'http://www.mymantis.com/api/soap/mantisconnect.php?wsdl';
defURL = 'http://www.mymantis.com/api/soap/mantisconnect.php';
defSvc = 'MantisConnect';
defPrt = 'MantisConnectPort';
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 MantisConnectPortType);
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;
mc_version
является частью
MantisConnectPortType = interface(IInvokable)
a имеет объявление:
function mc_version: string; stdcall;