1,593
社区成员
发帖
与我相关
我的任务
分享
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,YtFaxWebService, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
aa:YtFaxWebServiceSoap;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
aa:=GetYtFaxWebServiceSoap(False,'',nil);
ShowMessage(aa.YtDoAction(Edit1.Text));
end;
end.
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://service.tel99.cn/YtFaxWebService.asmx?WSDL
// Encoding : utf-8
// Version : 1.0
// (2010/9/17 上午 11:38:10 - 1.33.2.5)
// ************************************************************************ //
unit YtFaxWebService;
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://soap.model.service.YuanTel.com
// soapAction: http://soap.model.service.YuanTel.com/FaxDoAction
// transport : http://schemas.xmlsoap.org/soap/http
// binding : YtFaxWebServiceSoap
// service : YtFaxWebService
// port : YtFaxWebServiceSoap
// URL : http://service.tel99.cn/YtFaxWebService.asmx
// ************************************************************************ //
YtFaxWebServiceSoap = interface(IInvokable)
['{67D18A09-D65C-6CDE-BBD4-DF9A35E18511}']
function YtDoAction(const _xml: WideString): WideString; stdcall;
end;
function GetYtFaxWebServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): YtFaxWebServiceSoap;
implementation
function GetYtFaxWebServiceSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): YtFaxWebServiceSoap;
const
defWSDL = 'http://service.tel99.cn/YtFaxWebService.asmx?WSDL';
defURL = 'http://service.tel99.cn/YtFaxWebService.asmx';
defSvc = 'YtFaxWebService';
defPrt = 'YtFaxWebServiceSoap';
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 YtFaxWebServiceSoap);
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(YtFaxWebServiceSoap), 'http://soap.model.service.YuanTel.com', 'utf-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(YtFaxWebServiceSoap), 'http://soap.model.service.YuanTel.com/FaxDoAction');
end.
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://soap.model.service.YuanTel.com" />