如何调用????
unit WSDL;
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/2000/10/XMLSchema"
// ************************************************************************ //
// Namespace : http://xmlrad.com/WSFindMP3Bin/WSFindMP3.dll/wsdl
// soapAction: FindMP3
// transport : http://schemas.xmlsoap.org/soap/http
// style : rpc
// binding : WSFindMP3Binding
// service : WSFindMP3Service
// port : WSFindMP3Port
// URL : http://xmlrad.com/WSFindMP3Bin/WSFindMP3.dll
// ************************************************************************ //
WSFindMP3PortType = interface(IInvokable)
['{E457DCF3-304F-29EC-B38A-7A50C0B4EEBD}']
procedure FindMP3(const SearchString: String; const MaxReturn: String); stdcall;
end;
function GetWSFindMP3PortType(UseWSDL: Boolean=System.False; Addr: string=''): WSFindMP3PortType;
implementation
uses SOAPHTTPClient;
function GetWSFindMP3PortType(UseWSDL: Boolean; Addr: string): WSFindMP3PortType;
const
defWSDL = 'http://xmlrad.com/WSFindMP3Bin/WSFindMP3.dll/WSDL';
defURL = 'http://xmlrad.com/WSFindMP3Bin/WSFindMP3.dll';
defSvc = 'WSFindMP3Service';
defPrt = 'WSFindMP3Port';
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 WSFindMP3PortType);
finally
if Result = nil then
RIO.Free;
end;
end;
initialization
InvRegistry.RegisterInterface(TypeInfo(WSFindMP3PortType), 'http://xmlrad.com/WSFindMP3Bin/WSFindMP3.dll/wsdl', '');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(WSFindMP3PortType), 'FindMP3');
end.