how to I pass interface type to over procedure parameter ?
type
Hello_PortType = interface(ISoapInvokable)
['{243CBD89-8766-F19D-38DF-427D7A02EAEE}']
function GetDeneme(s: string): string;
end;
SoapCall(Hello_PortType , 'http://localhost:8080/wsdl/ITDeneme');
then how to get TypeInfo using with saopcall method variable ?
function TLib.SoapCall(Intf: Variant; Addr: string): ISoapInvokable;
var
RIO: THTTPRIO;
begin
InvRegistry.RegisterInterface(TypeInfo(Intf), 'urn:DenemeIntf-IDeneme', ''); //-- type info doesn't work with variant
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(Intf), 'GetDeneme');
Result := nil;
if Addr = '' then
exit();
RIO := THTTPRIO.Create(nil);
try
Result := RIO as ISoapInvokable;
RIO.URL := Addr;
finally
if (Result = nil) then
RIO.Free;
end;
end;
You need to specify the TypeInfo()
pointer, not the interface type.
SoapCall(TypeInfo(Hello_PortType) , 'http://localhost:8080/wsdl/ITDeneme');
function TLib.SoapCall(TypInfo: pointer; Addr: string): ISoapInvokable;
var
RIO: THTTPRIO;
begin
InvRegistry.RegisterInterface(TypInfo, 'urn:DenemeIntf-IDeneme', '');
InvRegistry.RegisterDefaultSOAPAction(TypInfo, 'GetDeneme');
...
Don't use a variant here - it doesn't make any sense, since you expect an interface type, not an interface instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With