在Delphi7中,引用了webservice(SMSService),在form中使用,编译时时报错提示undeclared identifier:SMSSendService
请帮忙解决一下。procedure Tsms_frm.Button1Click(Sender: TObject);
begin
SMSService.SMSSendService(Edit1.Text, Edit2.Text, Edit3.Text,Edit4.Text,Edit5.Text,'Text');
end;SMSService的源码如下:
unit SMSService;interfaceuses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;type // ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:string - "http://www.w3.org/2001/XMLSchema"
// !:boolean - "http://www.w3.org/2001/XMLSchema" SMSHeader = class; { "http://tempuri.org/"[H] } // ************************************************************************ //
// Namespace : http://tempuri.org/
// ************************************************************************ //
SMSHeader = class(TSOAPHeader)
private
FUsername: WideString;
FPassword: WideString;
published
property Username: WideString read FUsername write FUsername;
property Password: WideString read FPassword write FPassword;
end;
// ************************************************************************ //
// Namespace : http://tempuri.org/
// soapAction: http://tempuri.org/%operationName%
// transport : http://schemas.xmlsoap.org/soap/http
// binding : SMSServiceSoap
// service : SMSService
// port : SMSServiceSoap
// URL : http://10.33.1.161/SMSWebservice/SMSService.asmx
// ************************************************************************ //
SMSServiceSoap = interface(IInvokable)
['{11CF83A4-F2FD-01D8-0F6B-71F055031D1C}']
function SMSSendService(const SenderID: WideString; const SenderName: WideString; const Content: WideString; const TargetNumber: WideString; const TargetName: WideString; const Application: WideString): Boolean; stdcall;
function SMSSendServiceByID(const SenderID: WideString; const SenderName: WideString; const Content: WideString; const TargetID: WideString; const TargetName: WideString; const Application: WideString): Boolean; stdcall;
end;function GetSMSServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): SMSServiceSoap;
请帮忙解决一下。procedure Tsms_frm.Button1Click(Sender: TObject);
begin
SMSService.SMSSendService(Edit1.Text, Edit2.Text, Edit3.Text,Edit4.Text,Edit5.Text,'Text');
end;SMSService的源码如下:
unit SMSService;interfaceuses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;type // ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:string - "http://www.w3.org/2001/XMLSchema"
// !:boolean - "http://www.w3.org/2001/XMLSchema" SMSHeader = class; { "http://tempuri.org/"[H] } // ************************************************************************ //
// Namespace : http://tempuri.org/
// ************************************************************************ //
SMSHeader = class(TSOAPHeader)
private
FUsername: WideString;
FPassword: WideString;
published
property Username: WideString read FUsername write FUsername;
property Password: WideString read FPassword write FPassword;
end;
// ************************************************************************ //
// Namespace : http://tempuri.org/
// soapAction: http://tempuri.org/%operationName%
// transport : http://schemas.xmlsoap.org/soap/http
// binding : SMSServiceSoap
// service : SMSService
// port : SMSServiceSoap
// URL : http://10.33.1.161/SMSWebservice/SMSService.asmx
// ************************************************************************ //
SMSServiceSoap = interface(IInvokable)
['{11CF83A4-F2FD-01D8-0F6B-71F055031D1C}']
function SMSSendService(const SenderID: WideString; const SenderName: WideString; const Content: WideString; const TargetNumber: WideString; const TargetName: WideString; const Application: WideString): Boolean; stdcall;
function SMSSendServiceByID(const SenderID: WideString; const SenderName: WideString; const Content: WideString; const TargetID: WideString; const TargetName: WideString; const Application: WideString): Boolean; stdcall;
end;function GetSMSServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): SMSServiceSoap;
解决方案 »
- 如何判断-----------------一个日期是否在两个日期之间?
- 重复查询结果显示问题,在线等.高分呈献.
- 在Delphi中如何实现字符和数字之间的转换?
- 谁能说说在Delphi中的 TStack,TList的用法,及其区别
- 请问超级兔子的那个界面是怎么作出来的?好像是一个Pagecontrol控件,但他的按扭(标签)是平 的?当鼠标移进时按扭(标签)怎么变颜色?
- 关于WebBrowser控件的一个问题,在线等待答案
- 简单问题,在字符映射表中得到的unicode,如何插放当前输入框
- 高分儿,兄弟们看过来
- <<<<<相信pop高手肯定遇到过这个问题。
- 怎样才能控制程序的一次运行(即点击时只有一次的运行状态)?(以下的代码不行)请各位高手指教!
- Delphi中怎么申明这个函数
- 怎样能在应用程序结束前执行一段代码?
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://10.33.1.161/SMSWebservice/SMSService.asmx?wsdl
// Encoding : utf-8
// Version : 1.0
// (2011-04-19 8:31:17 - 1.33.2.5)
// ************************************************************************ //unit SMSService;interfaceuses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;type // ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:string - "http://www.w3.org/2001/XMLSchema"
// !:boolean - "http://www.w3.org/2001/XMLSchema" SMSHeader = class; { "http://tempuri.org/"[H] } // ************************************************************************ //
// Namespace : http://tempuri.org/
// ************************************************************************ //
SMSHeader = class(TSOAPHeader)
private
FUsername: WideString;
FPassword: WideString;
published
property Username: WideString read FUsername write FUsername;
property Password: WideString read FPassword write FPassword;
end;
// ************************************************************************ //
// Namespace : http://tempuri.org/
// soapAction: http://tempuri.org/%operationName%
// transport : http://schemas.xmlsoap.org/soap/http
// binding : SMSServiceSoap
// service : SMSService
// port : SMSServiceSoap
// URL : http://10.99.6.23/SMSWebservice/SMSService.asmx
// ************************************************************************ //
SMSServiceSoap = interface(IInvokable)
['{11CF83A4-F2FD-01D8-0F6B-71F055031D1C}']
function SMSSendService(const SenderID: WideString; const SenderName: WideString; const Content: WideString; const TargetNumber: WideString; const TargetName: WideString; const Application: WideString): Boolean; stdcall;
function SMSSendServiceByID(const SenderID: WideString; const SenderName: WideString; const Content: WideString; const TargetID: WideString; const TargetName: WideString; const Application: WideString): Boolean; stdcall;
end;function GetSMSServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): SMSServiceSoap;
implementationfunction GetSMSServiceSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): SMSServiceSoap;
const
defWSDL = 'http://10.99.6.23/SMSWebservice/SMSService.asmx?wsdl';
defURL = 'http://10.99.6.23/SMSWebservice/SMSService.asmx';
defSvc = 'SMSService';
defPrt = 'SMSServiceSoap';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as SMSServiceSoap);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;
initialization
InvRegistry.RegisterInterface(TypeInfo(SMSServiceSoap), 'http://tempuri.org/', 'utf-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(SMSServiceSoap), 'http://tempuri.org/%operationName%');
InvRegistry.RegisterHeaderClass(TypeInfo(SMSServiceSoap), SMSHeader, 'SMSHeader', '');
RemClassRegistry.RegisterXSClass(SMSHeader, 'http://tempuri.org/', 'SMSHeader');end.