1,593
社区成员
发帖
与我相关
我的任务
分享
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://localhost/GEO/Ws/Geocode.asmx?wsdl
// Encoding : utf-8
// Version : 1.0
// (2011-1-24 18:35:03 - 1.33.2.5)
// ************************************************************************ //
unit Geocode;
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/GetGeocode
// transport : http://schemas.xmlsoap.org/soap/http
// binding : GeocodeSoap
// service : Geocode
// port : GeocodeSoap
// URL : http://localhost/GEO/Ws/Geocode.asmx
// ************************************************************************ //
GeocodeSoap = interface(IInvokable)
['{C4F18C72-B3E9-5DF5-19AA-6813365712B2}']
function GetGeocode(const Longitude: WideString; const Latitude: WideString): WideString; stdcall;
end;
function GetGeocodeSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): GeocodeSoap;
implementation
function GetGeocodeSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): GeocodeSoap;
const
defWSDL = 'http://localhost/GEO/Ws/Geocode.asmx?wsdl';
defURL = 'http://localhost/GEO/Ws/Geocode.asmx';
defSvc = 'Geocode';
defPrt = 'GeocodeSoap';
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 GeocodeSoap);
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(GeocodeSoap), 'http://tempuri.org/', 'utf-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(GeocodeSoap), 'http://tempuri.org/GetGeocode');
InvRegistry.RegisterInvokeOptions(TypeInfo(GeocodeSoap), ioDocument);
end.