You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Bin Liu <i3...@3cn.com.cn> on 2002/04/12 10:31:44 UTC

errors with my delphi client

hi all:
i have installed resin and axis,and running my service of http://localhost:8080/Calculator.jws i use delphi to develope the client side,it's only a simple exaple,but it drop me in troubles,when i run the program and click button1 ,it's appears something  wrong: parameter wrong  with the code "my.add(i1,i2);"
i am appreciate for your help
here is the source code (comment omitted ):
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Rio, SoapHTTPClient,Unit2;
type
  TForm1 = class(TForm)
    HTTPRIO1: THTTPRIO;
    Button1: TButton;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
  private
  public
  end;
var
  Form1: TForm1;
implementation
procedure TForm1.Button1Click(Sender: TObject);
var
my : Calculator;
result :Integer;
i1: Integer;
i2: Integer;
begin
result:=0;
i1:=2;
i2:=7;
my:=Httprio1 as Calculator;
result:=my.add(i1,i2);
edit1.Text:=inttostr(result);
end;
end.
Unit Unit2;
interface
uses Types, XSBuiltIns;
type
  Calculator = interface(IInvokable)
    ['{A1C07BBE-3A4A-4541-9228-D2E7FEB7B795}']
    function add(const i1: Integer; const i2: Integer): Integer;  stdcall;
    function subtract(const i1: Integer; const i2: Integer): Integer;  stdcall;
  end;

implementation
uses InvokeRegistry;
initialization
  InvRegistry.RegisterInterface(TypeInfo(Calculator), '', 'UTF-8');
end.