⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iproductservice_wad1.pas

📁 delphi实现 webservice的例子.有服务端和客户段 利用xml交互.
💻 PAS
字号:
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://localhost:8081/ProductService_WAD.PoductService_WAD/wsdl/IProductService_WAD
// Encoding : utf-8
// Version  : 1.0
// (2009-4-28 上午 09:17:53 - 1.33.2.5)
// ************************************************************************ //

unit IProductService_WAD1;

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.
  // ************************************************************************ //
  // !:int             - "http://www.w3.org/2001/XMLSchema"
  // !:string          - "http://www.w3.org/2001/XMLSchema"


  // ************************************************************************ //
  // Namespace : urn:ProductService_WADIntf-IProductService_WAD
  // soapAction: urn:ProductService_WADIntf-IProductService_WAD#%operationName%
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : rpc
  // binding   : IProductService_WADbinding
  // service   : IProductService_WADservice
  // port      : IProductService_WADPort
  // URL       : http://localhost:8081/ProductService_WAD.PoductService_WAD/soap/IProductService_WAD
  // ************************************************************************ //
  IProductService_WAD = interface(IInvokable)
  ['{9BD7C852-B2D6-BF19-2584-F207F70A0F1B}']
     function GetProductByDate(Xmldata:WideString):WideString;stdcall;
     function GetProduct(Xmldata:Widestring):WideString;stdcall;
     function UpdateProduct(Xmldata:Widestring):WideString;stdcall;
     Function Login(Xmldata:WideString):Widestring;stdcall;
     function GetProductImage(Xmldata:WideString):WideString;stdcall;
     function PostProductImage(Xmldata:WideString):WideString;stdcall;
  end;

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


implementation

function GetIProductService_WAD(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IProductService_WAD;
const
  defWSDL = 'http://localhost:8081/ProductService_WAD.PoductService_WAD/wsdl/IProductService_WAD';
  defURL  = 'http://localhost:8081/ProductService_WAD.PoductService_WAD/soap/IProductService_WAD';
  defSvc  = 'IProductService_WADservice';
  defPrt  = 'IProductService_WADPort';
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 IProductService_WAD);
    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(IProductService_WAD), 'urn:ProductService_WADIntf-IProductService_WAD', 'utf-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(IProductService_WAD), 'urn:ProductService_WADIntf-IProductService_WAD#%operationName%');

end. 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -