Service.pas 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // ************************************************************************ //
  2. // The types declared in this file were generated from data read from the
  3. // WSDL File described below:
  4. // WSDL : http://service2.winic.org/Service.asmx?WSDL
  5. // Encoding : utf-8
  6. // Version : 1.0
  7. // (2009-2-19 11:07:19 - 1.33.2.5)
  8. // ************************************************************************ //
  9. unit Service2;
  10. interface
  11. uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
  12. type
  13. // ************************************************************************ //
  14. // The following types, referred to in the WSDL document are not being represented
  15. // in this file. They are either aliases[@] of other types represented or were referred
  16. // to but never[!] declared in the document. The types from the latter category
  17. // typically map to predefined/known XML or Borland types; however, they could also
  18. // indicate incorrect WSDL documents that failed to declare or import a schema type.
  19. // ************************************************************************ //
  20. // !:string - "http://www.w3.org/2001/XMLSchema"
  21. // !:base64Binary - "http://www.w3.org/2001/XMLSchema"
  22. // ************************************************************************ //
  23. // Namespace : http://tempuri.org/
  24. // soapAction: http://tempuri.org/%operationName%
  25. // transport : http://schemas.xmlsoap.org/soap/http
  26. // binding : Service1Soap
  27. // service : Service1
  28. // port : Service1Soap
  29. // URL : http://service2.winic.org/Service.asmx
  30. // ************************************************************************ //
  31. Service1Soap = interface(IInvokable)
  32. ['{CFE467D4-A39E-2BD2-5836-7685A9E27F8D}']
  33. function RegineUser(const uid: WideString; const pwd: WideString; const agent_code: WideString; const co_name: WideString; const link_man: WideString; const mob: WideString): WideString; stdcall;
  34. function GetUserInfo(const uid: WideString; const pwd: WideString): WideString; stdcall;
  35. function EditUserPwd(const uid: WideString; const pwd: WideString; const newpwd: WideString): WideString; stdcall;
  36. function SendMessages(const uid: WideString; const pwd: WideString; const tos: WideString; const msg: WideString; const otime: WideString): WideString; stdcall;
  37. function SendFax(const uid: WideString; const pwd: WideString; const faxno: WideString; const men: WideString; const title: WideString; const Bytes: TByteDynArray; const FileName: WideString): WideString; stdcall;
  38. function GetMessageInfo(const snum: WideString): WideString; stdcall;
  39. function SendVoice(const uid: WideString; const pwd: WideString; const vto: WideString; const vtxt: WideString; const mode: WideString; const FileBytes: TByteDynArray; const svrno: WideString; const str_time: WideString; const end_time: WideString): WideString; stdcall;
  40. function GetFaxRecord(const uid: WideString; const pwd: WideString; const num: WideString; const StartDate: WideString; const EndDate: WideString): WideString; stdcall;
  41. function GetVoiceRecord(const uid: WideString; const pwd: WideString; const num: WideString; const StartDate: WideString; const EndDate: WideString): WideString; stdcall;
  42. function GetMessageRecord(const uid: WideString; const pwd: WideString; const num: WideString; const StartDate: WideString; const EndDate: WideString): WideString; stdcall;
  43. function TelCall(const uid: WideString; const pwd: WideString; const host_call: WideString; const caller: WideString): WideString; stdcall;
  44. end;
  45. function GetService1Soap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): Service1Soap;
  46. implementation
  47. function GetService1Soap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): Service1Soap;
  48. const
  49. defWSDL = 'http://service2.winic.org/Service.asmx?WSDL';
  50. defURL = 'http://service2.winic.org/Service.asmx';
  51. defSvc = 'Service1';
  52. defPrt = 'Service1Soap';
  53. var
  54. RIO: THTTPRIO;
  55. begin
  56. Result := nil;
  57. if (Addr = '') then
  58. begin
  59. if UseWSDL then
  60. Addr := defWSDL
  61. else
  62. Addr := defURL;
  63. end;
  64. if HTTPRIO = nil then
  65. RIO := THTTPRIO.Create(nil)
  66. else
  67. RIO := HTTPRIO;
  68. try
  69. Result := (RIO as Service1Soap);
  70. if UseWSDL then
  71. begin
  72. RIO.WSDLLocation := Addr;
  73. RIO.Service := defSvc;
  74. RIO.Port := defPrt;
  75. end else
  76. RIO.URL := Addr;
  77. finally
  78. if (Result = nil) and (HTTPRIO = nil) then
  79. RIO.Free;
  80. end;
  81. end;
  82. initialization
  83. InvRegistry.RegisterInterface(TypeInfo(Service1Soap), 'http://tempuri.org/', 'utf-8');
  84. InvRegistry.RegisterDefaultSOAPAction(TypeInfo(Service1Soap), 'http://tempuri.org/%operationName%');
  85. //delphi调用net2.0在自动生成的Service.pas文件里需要加这一行。否则会出错。
  86. InvRegistry.RegisterInvokeOptions(TypeInfo(Service1Soap), ioDocument);
  87. end.