clientu1.pas

来自「基于Delphi6的WebServices及其实现」· PAS 代码 · 共 45 行

PAS
45
字号
unit clientu1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,SoapHTTPClient,clientu2;
type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Edit3: TEdit;
    Label4: TLabel;
    Edit4: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  X:THTTPRio;
  InterfaceVariable:IMyAddSub;
  x1, x2:Integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
   X := THTTPRio.Create(nil);
   X.URL := 'http://www.risksoft.com/webservice/webstest.dll/soap/IMyAddSub';
{   X.WSDLLocation := 'webstest.wsdl';
  X.Service := 'IMyAddSubservice';
  X.Port := 'IMyAddSubPort';  }
   InterfaceVariable := X as IMyAddSub;
   x1:= InterfaceVariable.MyAdd(StrToInt(edit1.Text),StrToInt(edit2.Text));
   x2:= InterfaceVariable.MySub(StrToInt(edit1.Text),StrToInt(edit2.Text));
   edit3.Text:=IntToStr(x1);
   edit4.Text:=IntToStr(x2);
end;
end.

⌨️ 快捷键说明

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