H
hunyuan
Unregistered / Unconfirmed
GUEST, unregistred user!
http://mental.top263.net/mentals/progart/tech/d6_soap1.htm
按照以上网址的例子,服务器端源码如下:
unit MainWM;
interface
uses
SysUtils, Classes, HTTPApp, WSDLPub, SOAPPasInv, SOAPHTTPPasInv,
SoapHTTPDisp, WebBrokerSOAP;
type
TWebModule1 = class(TWebModule)
HTTPSoapDispatcher1: THTTPSoapDispatcher;
HTTPSoapPascalInvoker1: THTTPSoapPascalInvoker;
WSDLHTMLPublish1: TWSDLHTMLPublish;
private
{ Private declarations }
public
{ Public declarations }
end;
ISoapHello = Interface (IInvokable)
['{25C75B89-B4B5-11D5-AFBA-0000F01B4577}'] // 这个GUID你自己用 Ctrl+Shift+G 产生
Function GetHello( aID : Integer ) : WideString;
StdCall;
end;
TSoapHello = Class(TInvokableClass,ISoapHello)
Protected
Function GetHello( aID : Integer ) : WideString;
StdCall;
end;
var
WebModule1: TWebModule1;
implementation
{$R *.DFM}
uses
InvokeRegistry;
Initialization
InvRegistry.RegisterInterface(TypeInfo(ISoapHello));
InvRegistry.RegisterInvokableClass(TSoapHello);
Function TSoapHello.GetHello(aID:Integer):WideString;
begin
If (aID=1) then
Result:='Hello world!'
else
Result:= Error ID!';
end;
end.
无法调试通过,请指出语法错误!
按照以上网址的例子,服务器端源码如下:
unit MainWM;
interface
uses
SysUtils, Classes, HTTPApp, WSDLPub, SOAPPasInv, SOAPHTTPPasInv,
SoapHTTPDisp, WebBrokerSOAP;
type
TWebModule1 = class(TWebModule)
HTTPSoapDispatcher1: THTTPSoapDispatcher;
HTTPSoapPascalInvoker1: THTTPSoapPascalInvoker;
WSDLHTMLPublish1: TWSDLHTMLPublish;
private
{ Private declarations }
public
{ Public declarations }
end;
ISoapHello = Interface (IInvokable)
['{25C75B89-B4B5-11D5-AFBA-0000F01B4577}'] // 这个GUID你自己用 Ctrl+Shift+G 产生
Function GetHello( aID : Integer ) : WideString;
StdCall;
end;
TSoapHello = Class(TInvokableClass,ISoapHello)
Protected
Function GetHello( aID : Integer ) : WideString;
StdCall;
end;
var
WebModule1: TWebModule1;
implementation
{$R *.DFM}
uses
InvokeRegistry;
Initialization
InvRegistry.RegisterInterface(TypeInfo(ISoapHello));
InvRegistry.RegisterInvokableClass(TSoapHello);
Function TSoapHello.GetHello(aID:Integer):WideString;
begin
If (aID=1) then
Result:='Hello world!'
else
Result:= Error ID!';
end;
end.
无法调试通过,请指出语法错误!