ar0*_*968 17 delphi soap mantis delphi-xe6
错误出现在ShowMessage(aServer.mc_version)此代码的行中:
uses mantisconnect;
procedure TForm.Button1Click(Sender: TObject);
var
aServer: MantisConnectPortType;
begin
aServer := GetMantisConnectPortType;
ShowMessage('Mantis version:' + aServer.mc_version);
end;
Run Code Online (Sandbox Code Playgroud)
相同的代码适用于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
Run Code Online (Sandbox Code Playgroud)
如果我再试一次(第二次点击按钮)就行了!输出:
Mantis version:1.2.9
Run Code Online (Sandbox Code Playgroud)
连接过程列表是
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;
Run Code Online (Sandbox Code Playgroud)
mc_version 是的一部分
MantisConnectPortType = interface(IInvokable)
Run Code Online (Sandbox Code Playgroud)
并有声明:
function mc_version: string; stdcall;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1525 次 |
| 最近记录: |