ihelloimpl.pas

来自「用Delphi实现Web Service的简单示例」· PAS 代码 · 共 57 行

PAS
57
字号
{ Invokable implementation File for TIHello which implements IIHello }

unit IHelloImpl;

interface

uses InvokeRegistry, Types, XSBuiltIns, IHelloIntf;

type

  { TIHello }
  TIHello = class(TInvokableClass, IIHello)
  public
    function echoEnum(const Value: TEnumTest): TEnumTest; stdcall;
    function echoDoubleArray(const Value: TDoubleArray): TDoubleArray; stdcall;
    function echoMyEmployee(const Value: TMyEmployee): TMyEmployee; stdcall;
    function echoDouble(const Value: Double): Double; stdcall;
    function sayHello(name: String): String; stdcall;
  end;

implementation

function TIHello.sayHello(name: String): String; stdcall;
begin
  Result := '您好 '+name+'这是最简单的WebService程序';
end;

function TIHello.echoEnum(const Value: TEnumTest): TEnumTest; stdcall;
begin
  { TODO : Implement method echoEnum }
  Result := Value;
end;

function TIHello.echoDoubleArray(const Value: TDoubleArray): TDoubleArray; stdcall;
begin
  { TODO : Implement method echoDoubleArray }
  Result := Value;
end;

function TIHello.echoMyEmployee(const Value: TMyEmployee): TMyEmployee; stdcall;
begin
  { TODO : Implement method echoMyEmployee }
  Result := TMyEmployee.Create;
end;

function TIHello.echoDouble(const Value: Double): Double; stdcall;
begin
  { TODO : Implement method echoDouble }
  Result := Value;
end;

initialization
  { Invokable classes must be registered }
  InvRegistry.RegisterInvokableClass(TIHello);

end.
 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?