|

楼主 |
发表于 2010-6-8 16:53:07
|
显示全部楼层
Unit SMAlarmServices;
interface
uses Types, XSBuiltIns;
type
SMAlarmZjjcnt = interface(IInvokable)
['{CD7C80A1-9174-4784-9C4D-FFF52CE7EFE3}']
procedure SMAlarm(const phoneNumbers: string; const msg: string; out SMAlarmReturn: Integer); stdcall;
end;
function GetSMAlarmZjjcnt(UseWSDL: Boolean; Addr: string): SMAlarmZjjcnt;
implementation
uses InvokeRegistry, SOAPHTTPClient;
function GetSMAlarmZjjcnt(UseWSDL: Boolean; Addr: string): SMAlarmZjjcnt;
const
defWSDL = 'http://127.0.0.1:7001/wjweb/services/SMAlarmZjjcnt?wsdl';
defURL = 'http://127.0.0.1:7001/wjweb/services/SMAlarmZjjcnt';
defSvc = 'SMAlarmZjjcntService';
defPrt = 'SMAlarmZjjcnt';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
RIO := THTTPRIO.Create(nil);
RIO.HTTPWebNode.UseUTF8InHeader := True;
try
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
Result := (RIO as SMAlarmZjjcnt);
finally
if Result = nil then
RIO.Free;
end;
end;
initialization
InvRegistry.RegisterInterface(TypeInfo(SMAlarmZjjcnt), '', 'UTF-8');
//InvRegistry.RegisterDefaultSOAPAction(TypeInfo(SMAlarmZjjcnt), 'http://tempuri.org/HelloWorld');
//InvRegistry.RegisterInvokeOptions(TypeInfo(SMAlarmZjjcnt),ioDocument);
end. |
|