www.pudn.com > DelphiCDSService2010.rar > Service1.pas, change:2009-12-25,size:3248b


// ************************************************************************ // 
// The types declared in this file were generated from data read from the 
// WSDL File described below: 
// WSDL     : http://localhost:1935/Service1.asmx?wsdl 
// Encoding : utf-8 
// Version  : 1.0 
// (2009-12-25 17:33:50 - - $Rev: 10138 $) 
// ************************************************************************ // 
 
unit Service1; 
 
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://tempuri.org/ 
  // soapAction: http://tempuri.org/%operationName% 
  // transport : http://schemas.xmlsoap.org/soap/http 
  // style     : rpc 
  // binding   : Service1Soap 
  // service   : Service1 
  // port      : Service1Soap 
  // URL       : http://localhost:1935/Service1.asmx 
  // ************************************************************************ // 
  Service1Soap = interface(IInvokable) 
  ['{CFE467D4-A39E-2BD2-5836-7685A9E27F8D}'] 
    function  HelloWorld: WideString; stdcall; 
    function  Buf_GetADONetToCDSXml(const ADbase: WideString; const ATable: WideString; const ASQL: WideString): WideString; stdcall; 
    function  Buf_PutCDSXmlToADONet(const ADbase: WideString; const ATable: WideString; const ADOData: WideString): WideString; stdcall; 
  end; 
 
function GetService1Soap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): Service1Soap; 
 
 
implementation 
  uses SysUtils; 
 
function GetService1Soap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): Service1Soap; 
const 
  defWSDL = 'http://localhost:1935/Service1.asmx?wsdl'; 
  defURL  = 'http://localhost:1935/Service1.asmx'; 
  defSvc  = 'Service1'; 
  defPrt  = 'Service1Soap'; 
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 Service1Soap); 
    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(Service1Soap), 'http://tempuri.org/', 'utf-8'); 
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(Service1Soap), 'http://tempuri.org/%operationName%'); 
 
end.