zoukankan      html  css  js  c++  java
  • 获取QQ状态接口开发示例

    unit checkqqstatus;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;
    
    type
      TForm1 = class(TForm)
        edt1: TEdit;
        btn1: TButton;
        procedure btn1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    uses
      qqOnlineWebService;
    
    {$R *.dfm}
    
    procedure TForm1.btn1Click(Sender: TObject);
    var
      statusQuery:qqOnlineWebServiceSoap;
      edt:string;
      sta:string;
    begin
        statusQuery:=GetqqOnlineWebServiceSoap;
        edt:=edt1.text;
        sta:=statusQuery.qqCheckOnline(edt);
        ShowMessage(sta);
    end;
    
    end.
    // ************************************************************************ //
    // The types declared in this file were generated from data read from the
    // WSDL File described below:
    // WSDL     : http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl
    // Encoding : utf-8
    // Version  : 1.0
    // (2016-11-30 11:04:28 - 1.33.2.5)
    // ************************************************************************ //
    
    unit qqOnlineWebService;
    
    interface
    
    uses 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"
    
    
    
      // ************************************************************************ //
      // Namespace : http://WebXml.com.cn/
      // soapAction: http://WebXml.com.cn/qqCheckOnline
      // transport : http://schemas.xmlsoap.org/soap/http
      // binding   : qqOnlineWebServiceSoap
      // service   : qqOnlineWebService
      // port      : qqOnlineWebServiceSoap
      // URL       : http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx
      // ************************************************************************ //
      qqOnlineWebServiceSoap = interface(IInvokable)
      ['{8F8F3AAE-2C23-E432-54FD-4ECB5EB53CC0}']
        function  qqCheckOnline(const qqCode: WideString): WideString; stdcall;
      end;
    
    function GetqqOnlineWebServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): qqOnlineWebServiceSoap;
    
    
    implementation
    
    function GetqqOnlineWebServiceSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): qqOnlineWebServiceSoap;
    const
      defWSDL = 'http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl';
      defURL  = 'http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx';
      defSvc  = 'qqOnlineWebService';
      defPrt  = 'qqOnlineWebServiceSoap';
    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 qqOnlineWebServiceSoap);
        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(qqOnlineWebServiceSoap), 'http://WebXml.com.cn/', 'utf-8');
      InvRegistry.RegisterInvokeOptions(TypeInfo(qqOnlineWebServiceSoap),ioDocument);
      InvRegistry.RegisterDefaultSOAPAction(TypeInfo(qqOnlineWebServiceSoap), 'http://WebXml.com.cn/qqCheckOnline');
    
    end.
  • 相关阅读:
    如何过滤php中危险的HTML代码
    一个老总的语录
    php如何优化压缩的图片
    php时间函数time(),date(),mktime()区别
    php中获取网站访客来源的关键词方法
    php获取QQ头像并显示的方法
    php一些常规动态设置与获取
    xss过滤函数
    php获取当月的第一天以及最后一天
    php eval函数一句话木马代码
  • 原文地址:https://www.cnblogs.com/zyb2016/p/6126537.html
Copyright © 2011-2022 走看看