在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;

解决方案 »

  1.   

    SMSSendService找不到,在哪声明的,文件不全
      

  2.   

    // ************************************************************************ //
    // 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.