其实是这样,见代码
{ SOAP WebModule }
unit MainWM;interfaceuses
SysUtils, Classes, HTTPApp,InvokeRegistry, WSDLIntf, TypInfo, WebServExp,
WSDLBind, XMLSchema, WSDLPub, SOAPPasInv, SOAPHTTPPasInv, SOAPHTTPDisp,
WebBrokerSOAP, DB, ADODB;type
TWebModule1 = class(TWebModule)
HTTPSoapDispatcher1: THTTPSoapDispatcher;
HTTPSoapPascalInvoker1: THTTPSoapPascalInvoker;
WSDLHTMLPublish1: TWSDLHTMLPublish;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
procedure WebModule1DefaultHandlerAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
ISoapHello = Interface ( IInvokable )
['{6DF34980-6FFC-11D5-9E62-0050BABD8FE1}'] // 这个GUID你自己用 Ctrl+Shift+G 产生
Function GetHello( aID : Integer ) : WideString; StdCall;
Function GetHelloff( aID : Integer ) : WideString; StdCall;
End;
TSoapHello = Class ( TInvokableClass, ISoapHello )
Protected
Function GetHelloff( aID : Integer ) : WideString; StdCall;
Function GetHello( aID : Integer ) : WideString; StdCall;
End; ISoapHello1 = Interface ( IInvokable )
['{BCEC4BFC-0E0E-488E-9250-3E24A5DE423D}'] // 这个GUID你自己用 Ctrl+Shift+G 产生
Function GetHello1( aID : Integer ) : WideString; StdCall;
End;
TSoapHello1 = Class ( TInvokableClass, ISoapHello1 )
Protected
Function GetHello1( aID : Integer ) : WideString; StdCall;
End;var
WebModule1: TWebModule1;implementation{$R *.dfm}procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
WSDLHTMLPublish1.ServiceInfo(Sender, Request, Response, Handled);
end;Function TSoapHello.GetHello( aID : Integer ) : WideString;
Begin
If ( aID = 1 ) Then
Result := 'Hello world!'
Else
ADOQuery1.xxx //Result := 'Error ID!';
End;Function TSoapHello.GetHelloff( aID : Integer ) : WideString;
Begin
If ( aID = 2 ) Then
Result := 'Hello world!'
Else
Result := 'Error ID!';
End;Function TSoapHello1.GetHello1( aID : Integer ) : WideString;
Begin
If ( aID = 1 ) Then
Result := 'Hello world!'
Else
Result := 'Error ID!';
End;Initialization
InvRegistry.RegisterInterface( TypeInfo( ISoapHello ) );
InvRegistry.RegisterInvokableClass( TSoapHello );
InvRegistry.RegisterInterface( TypeInfo( ISoapHello1 ) );
InvRegistry.RegisterInvokableClass( TSoapHello1 );
end.我想在“ADOQuery1.xxx”这里写点东西,可是一写“.”后就提示Build
[Error] MainWM.pas(64): Undeclared identifier: 'ADOQuery1'
[Fatal Error] SoapTest.dpr(10): Could not compile used unit 'MainWM.pas'说我未声明ADOQuery1,怎么会呢?我都是在IDE里托进来的
{ SOAP WebModule }
unit MainWM;interfaceuses
SysUtils, Classes, HTTPApp,InvokeRegistry, WSDLIntf, TypInfo, WebServExp,
WSDLBind, XMLSchema, WSDLPub, SOAPPasInv, SOAPHTTPPasInv, SOAPHTTPDisp,
WebBrokerSOAP, DB, ADODB;type
TWebModule1 = class(TWebModule)
HTTPSoapDispatcher1: THTTPSoapDispatcher;
HTTPSoapPascalInvoker1: THTTPSoapPascalInvoker;
WSDLHTMLPublish1: TWSDLHTMLPublish;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
procedure WebModule1DefaultHandlerAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
ISoapHello = Interface ( IInvokable )
['{6DF34980-6FFC-11D5-9E62-0050BABD8FE1}'] // 这个GUID你自己用 Ctrl+Shift+G 产生
Function GetHello( aID : Integer ) : WideString; StdCall;
Function GetHelloff( aID : Integer ) : WideString; StdCall;
End;
TSoapHello = Class ( TInvokableClass, ISoapHello )
Protected
Function GetHelloff( aID : Integer ) : WideString; StdCall;
Function GetHello( aID : Integer ) : WideString; StdCall;
End; ISoapHello1 = Interface ( IInvokable )
['{BCEC4BFC-0E0E-488E-9250-3E24A5DE423D}'] // 这个GUID你自己用 Ctrl+Shift+G 产生
Function GetHello1( aID : Integer ) : WideString; StdCall;
End;
TSoapHello1 = Class ( TInvokableClass, ISoapHello1 )
Protected
Function GetHello1( aID : Integer ) : WideString; StdCall;
End;var
WebModule1: TWebModule1;implementation{$R *.dfm}procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
WSDLHTMLPublish1.ServiceInfo(Sender, Request, Response, Handled);
end;Function TSoapHello.GetHello( aID : Integer ) : WideString;
Begin
If ( aID = 1 ) Then
Result := 'Hello world!'
Else
ADOQuery1.xxx //Result := 'Error ID!';
End;Function TSoapHello.GetHelloff( aID : Integer ) : WideString;
Begin
If ( aID = 2 ) Then
Result := 'Hello world!'
Else
Result := 'Error ID!';
End;Function TSoapHello1.GetHello1( aID : Integer ) : WideString;
Begin
If ( aID = 1 ) Then
Result := 'Hello world!'
Else
Result := 'Error ID!';
End;Initialization
InvRegistry.RegisterInterface( TypeInfo( ISoapHello ) );
InvRegistry.RegisterInvokableClass( TSoapHello );
InvRegistry.RegisterInterface( TypeInfo( ISoapHello1 ) );
InvRegistry.RegisterInvokableClass( TSoapHello1 );
end.我想在“ADOQuery1.xxx”这里写点东西,可是一写“.”后就提示Build
[Error] MainWM.pas(64): Undeclared identifier: 'ADOQuery1'
[Fatal Error] SoapTest.dpr(10): Could not compile used unit 'MainWM.pas'说我未声明ADOQuery1,怎么会呢?我都是在IDE里托进来的
解决方案 »
- 求dbexpress for mysql4.0下载地址
- ..SOS..SOS..SOS..SOS..SOS..
- 如何用sql语言复制表啊?
- 我在winxp home edit中安装不了delphi6 或delphi 5,为什么?
- 关于COM技术
- 如何选取查询中的一部分数据,比如从第10到第20条数据。
- 如何在程序中建立一个进程,并获得该进程的主窗口句柄
- 数据和TREE问题,完成90%的人事管理程序,求助
- Delphi执行存储过程中出现的怪现象
- 怎样用COM通过ASM发送数据!Delphi高手请进。
- Adoconncetion如何同时连接两个服务器呢?在线等待!
- 如何使用 IHTMLDocument2 的 onmousemove 等事件
要不你再去侃侃tadoquery这个类得定义问题再哪里
在TSoapHello中要如此调用:WebModule1.ADOQuery1