通过如下步骤建立web server
1、new/other/Web Server/Soap Server Application/CGI Stand-alone executable:建立WebModule1
2、new/other/Web Server/Aoap Server Data Module(名称为data):建立如下接口Idata:
Unit Unit2;
interface
uses SysUtils, Classes, InvokeRegistry, Midas, SOAPMidas, SOAPDm; type
Idata = interface(IAppServerSOAP)
['{D5A88A4A-67BF-4AE3-8114-2EFEDA10B96D}']
end; Tdata = class(TSoapDataModule, Idata, IAppServerSOAP, IAppServer)
private
function getstr():string;
public
end; implementation {$R *.DFM} procedure TdataCreateInstance(out obj: TObject);
begin
obj := Tdata.Create(nil);
end; function Tdata.getstr():string;
begin
result:='ssssss';
end; initialization
InvRegistry.RegisterInvokableClass(Tdata, TdataCreateInstance);
InvRegistry.RegisterInterface(TypeInfo(Idata));
end.
3、把该工程放到IIS下,并成功获得URL。
创建客户端。
新建form,在form放WebServer组件的SoapConnection1,并给SoapConnection1的URL赋值,并成功连接到服务端接口Idata。请问:
我在客户端怎样获得服务端接口Idata的getstr()函数?????
我可以把我的上面那个很简单的小例子发给你们(留下QQ或em),帮帮我,好吗?
1、new/other/Web Server/Soap Server Application/CGI Stand-alone executable:建立WebModule1
2、new/other/Web Server/Aoap Server Data Module(名称为data):建立如下接口Idata:
Unit Unit2;
interface
uses SysUtils, Classes, InvokeRegistry, Midas, SOAPMidas, SOAPDm; type
Idata = interface(IAppServerSOAP)
['{D5A88A4A-67BF-4AE3-8114-2EFEDA10B96D}']
end; Tdata = class(TSoapDataModule, Idata, IAppServerSOAP, IAppServer)
private
function getstr():string;
public
end; implementation {$R *.DFM} procedure TdataCreateInstance(out obj: TObject);
begin
obj := Tdata.Create(nil);
end; function Tdata.getstr():string;
begin
result:='ssssss';
end; initialization
InvRegistry.RegisterInvokableClass(Tdata, TdataCreateInstance);
InvRegistry.RegisterInterface(TypeInfo(Idata));
end.
3、把该工程放到IIS下,并成功获得URL。
创建客户端。
新建form,在form放WebServer组件的SoapConnection1,并给SoapConnection1的URL赋值,并成功连接到服务端接口Idata。请问:
我在客户端怎样获得服务端接口Idata的getstr()函数?????
我可以把我的上面那个很简单的小例子发给你们(留下QQ或em),帮帮我,好吗?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货