北京福彩网 · 文档中心

短信验证码/通知 - 代码示例


DELPHI代码示例

//接口类型:北京福彩网触发短信接口,支持发送验证码短信、订单通知短信等。
//账户注册:请通过该地址开通账户http://www.kwsul.com.cn//register.html
//注意事项:
//(1)调试期间,请使用用系统默认的短信内容:您的验证码是:【变量】。请不要把验证码泄露给其他人。
//(2)请使用 用户名 及 APIkey来调用接口,APIkey在会员中心可以获取;
//(3)该代码仅供接入北京福彩网短信接口参考使用,客户可根据实际需要自行编写;

// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://www.kwsul.com.cn//webservice/sms.php?wsdl
//  >Import : http://www.kwsul.com.cn//webservice/sms.php?wsdl:0
// Encoding : utf-8
// Version  : 1.0
// (2013/11/26 10:37:24 - - $Rev: 10138 $)
// ************************************************************************ //

unit sms;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

const
  IS_OPTN = $0001;
  IS_REF  = $0080;


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.
  // ************************************************************************ //
  // !:int             - "http://www.kwsul.com.cn//2001/XMLSchema"[Gbl]
  // !:string          - "http://www.kwsul.com.cn//2001/XMLSchema"[Gbl]
  // !:srting          - "http://www.kwsul.com.cn//2001/XMLSchema"[Gbl]

  SubmitResult         = class;                 { "http://www.kwsul.com.cn//"[GblCplx] }
  ChangePasswordResult = class;                 { "http://www.kwsul.com.cn//"[GblCplx] }
  GetNumResult         = class;                 { "http://www.kwsul.com.cn//"[GblCplx] }
  VersionInfoResult    = class;                 { "http://www.kwsul.com.cn//"[GblCplx] }



  // ************************************************************************ //
  // XML       : SubmitResult, global, 
  // Namespace : http://www.kwsul.com.cn//
  // ************************************************************************ //
  SubmitResult = class(TRemotable)
  private
    Fcode: Integer;
    Fmsg: WideString;
    Fsmsid: Integer;
  published
    property code:  Integer     read Fcode write Fcode;
    property msg:   WideString  read Fmsg write Fmsg;
    property smsid: Integer     read Fsmsid write Fsmsid;
  end;



  // ************************************************************************ //
  // XML       : ChangePasswordResult, global, 
  // Namespace : http://www.kwsul.com.cn//
  // ************************************************************************ //
  ChangePasswordResult = class(TRemotable)
  private
    Fcode: Integer;
    Fmsg: WideString;
  published
    property code: Integer     read Fcode write Fcode;
    property msg:  WideString  read Fmsg write Fmsg;
  end;



  // ************************************************************************ //
  // XML       : GetNumResult, global, 
  // Namespace : http://www.kwsul.com.cn//
  // ************************************************************************ //
  GetNumResult = class(TRemotable)
  private
    Fcode: Integer;
    Fmsg: WideString;
    Fnum: Integer;
  published
    property code: Integer     read Fcode write Fcode;
    property msg:  WideString  read Fmsg write Fmsg;
    property num:  Integer     read Fnum write Fnum;
  end;



  // ************************************************************************ //
  // XML       : VersionInfoResult, global, 
  // Namespace : http://www.kwsul.com.cn//
  // ************************************************************************ //
  VersionInfoResult = class(TRemotable)
  private
    Fmsg: WideString;
  published
    property msg: WideString  read Fmsg write Fmsg;
  end;


  // ************************************************************************ //
  // Namespace : http://www.kwsul.com.cn//
  // soapAction: http://www.kwsul.com.cn//%operationName%
  // transport : http://www.kwsul.com.cn//soap/http
  // style     : document
  // binding   : smsSoap
  // service   : sms
  // port      : smsSoap
  // URL       : http://www.kwsul.com.cn//webservice/sms.php?smsService
  // ************************************************************************ //
  smsSoap = interface(IInvokable)
  ['{228902AE-4B53-39C9-05CA-F389FEE82174}']
    function  Submit(const account: WideString; const password: WideString; const mobile: WideString; const content: WideString): SubmitResult; stdcall;
    function  ChangePassword(const account: WideString; const password: WideString; const newpassword: WideString): ChangePasswordResult; stdcall;
    function  GetNum(const account: WideString; const password: WideString): GetNumResult; stdcall;
    function  VersionInfo: VersionInfoResult; stdcall;
  end;

function GetsmsSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): smsSoap;


implementation
  uses SysUtils;

function GetsmsSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): smsSoap;
const
  defWSDL = 'http://www.kwsul.com.cn//webservice/sms.php?wsdl';
  defURL  = 'http://www.kwsul.com.cn//webservice/sms.php?smsService';
  defSvc  = 'sms';
  defPrt  = 'smsSoap';
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 smsSoap);
    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(smsSoap), 'http://www.kwsul.com.cn//', 'utf-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(smsSoap), 'http://www.kwsul.com.cn//%operationName%');
  InvRegistry.RegisterInvokeOptions(TypeInfo(smsSoap), ioDocument);
  RemClassRegistry.RegisterXSClass(SubmitResult, 'http://www.kwsul.com.cn//', 'SubmitResult');
  RemClassRegistry.RegisterXSClass(ChangePasswordResult, 'http://www.kwsul.com.cn//', 'ChangePasswordResult');
  RemClassRegistry.RegisterXSClass(GetNumResult, 'http://www.kwsul.com.cn//', 'GetNumResult');
  RemClassRegistry.RegisterXSClass(VersionInfoResult, 'http://www.kwsul.com.cn//', 'VersionInfoResult');

end.


工作时段:4008 808 898
其他时段:
159 021 22672
159 0212 1631
11选5杀号大师100准确 江苏体彩七位数开奖号码 上海时时乐开奖走势图连线 彩88彩票网 时时彩到底输了多少人
幸运农场中奖 四川体彩金7乐推荐 快乐双彩 腾讯分分彩 官网查询 时时彩五星计划在线
时时彩如何看懂走势图 广西快乐十分奇偶走势图 今天快三走势图 时时彩25期反长龙 江西新十一选五走势图
网上投注 河南快赢481走势图 北京快中彩 电子游艺全网址 11选5任2神号期期必中