IEmailService1.pas
上传用户:netnetfish
上传日期:2021-01-14
资源大小:413k
文件大小:3k
源码类别:
Delphi/CppBuilder
开发平台:
Delphi
- // ************************************************************************ //
- // The types declared in this file were generated from data read from the
- // WSDL File described below:
- // WSDL : http://webservices.matlus.com/scripts/emailwebservice.dll/wsdl/IEmailService
- // Version : 1.0
- // (2002-11-20 15:14:26 - $Revision: 1.9.1.0.1.0.1.9 $)
- // ************************************************************************ //
- unit IEmailService1;
- interface
- uses InvokeRegistry, 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"
- // !:int - "http://www.w3.org/2001/XMLSchema"
- // ************************************************************************ //
- // Namespace : urn:EmailIPortTypeInft-IEmailService
- // soapAction: urn:EmailIPortTypeInft-IEmailService#SendMail
- // transport : http://schemas.xmlsoap.org/soap/http
- // style : rpc
- // binding : IEmailServicebinding
- // service : IEmailServiceservice
- // port : IEmailServicePort
- // URL : http://webservices.matlus.com/scripts/emailwebservice.dll/soap/IEmailservice
- // ************************************************************************ //
- IEmailService = interface(IInvokable)
- ['{DE379B44-6D5F-C03E-DC2A-035AD0651C54}']
- function SendMail(const ToAddress: String; const FromAddress: String; const ASubject: String; const MsgBody: String): Integer; stdcall;
- end;
- function GetIEmailService(UseWSDL: Boolean=System.False; Addr: string=''): IEmailService;
- implementation
- uses SOAPHTTPClient;
- function GetIEmailService(UseWSDL: Boolean; Addr: string): IEmailService;
- const
- defWSDL = 'http://webservices.matlus.com/scripts/emailwebservice.dll/wsdl/IEmailService';
- defURL = 'http://webservices.matlus.com/scripts/emailwebservice.dll/soap/IEmailservice';
- defSvc = 'IEmailServiceservice';
- defPrt = 'IEmailServicePort';
- var
- RIO: THTTPRIO;
- begin
- Result := nil;
- if (Addr = '') then
- begin
- if UseWSDL then
- Addr := defWSDL
- else
- Addr := defURL;
- end;
- RIO := THTTPRIO.Create(nil);
- try
- if UseWSDL then
- begin
- RIO.WSDLLocation := Addr;
- RIO.Service := defSvc;
- RIO.Port := defPrt;
- end else
- RIO.URL := Addr;
- Result := (RIO as IEmailService);
- finally
- if Result = nil then
- RIO.Free;
- end;
- end;
- initialization
- InvRegistry.RegisterInterface(TypeInfo(IEmailService), 'urn:EmailIPortTypeInft-IEmailService', '');
- InvRegistry.RegisterDefaultSOAPAction(TypeInfo(IEmailService), 'urn:EmailIPortTypeInft-IEmailService#SendMail');
- end.