25

The error appears in the ShowMessage(aServer.mc_version) line of this code:

uses mantisconnect;

procedure TForm.Button1Click(Sender: TObject);
var
   aServer: MantisConnectPortType;
begin
   aServer := GetMantisConnectPortType;
   ShowMessage('Mantis version:' + aServer.mc_version);
end;

The same code works on Delphi XE5, but compiled on Delphi XE6 triggers an error the first time (first click on the button), but it works the next time:

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

If I try again (second click on the button) it works! Output:

Mantis version:1.2.9

Listing of the connection procedure is

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 is a part of

MantisConnectPortType = interface(IInvokable)

and has the declaration:

function  mc_version: string; stdcall;
VLL
  • 9,634
  • 1
  • 29
  • 54
ar099968
  • 6,963
  • 12
  • 64
  • 127
  • I guess yes but, have you tried reimporting the `SOAP service`? It might have something to do with the [changes](http://edn.embarcadero.com/article/43754) they applied in `XE6` to the `SOAP` units. – Guillem Vicens Jun 09 '14 at 17:45
  • yes, I tried ... making debugging it seems that the bug is in the XE6 soap unit – ar099968 Jun 11 '14 at 06:50
  • 5
    It seems to be a bug in XE6: http://qc.embarcadero.com/wc/qcmain.aspx?d=124627 (the "Steps to Reproduce" section also shows how it can be fixed) – mjn Apr 21 '15 at 05:43
  • Has this since been fixed in newer versions of Delphi? Maybe close this question or write an answer saying it's been fixed? – Shaun Roselt Feb 28 '23 at 08:47

0 Answers0