How to pass parameter to IUPnPService.InvokeAction?

I have define the following SCPD document for my UPnP device:

<?xml version="1.0"?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0" >
    <stateVariable sendEvents="no">

I registered my UPnP device too. I also able to retrieve my UPnPDevice. How am I going to invoke the echo action as defined in SCPD document?

The code to invoke action should be something like:

var o: IUPnPDeviceFinder;
    d: IUPnPDevice;
    s: IUPnPService;
    E: IEnumVARIANT;
    K: OleVariant;
    iFetched: Cardinal;
    V1, V2: OleVariant;
    r: HRESULT;
  o := CoUPnPDeviceFinder.Create;
  d := o.FindByUDN('uuid:a6d332da-f8ce-43ce-8210-79eacd4231c6');

  E := d.Services._NewEnum as IEnumVARIANT;
  CheckOSError(E.Next(1, K, iFetched));

  s := IDispatch(K) as IUPnPService;

  r := s.InvokeAction('Echo', v1, v2);

How to form v1 and v2 parameters for InvokeAction?


According to MSDN Docs you should pass arguments as a Variant Array. In Delphi you can use VarArrayOf or VarArrayCreate function

Need Your Help

Configure JCache implementation in Spring

spring ehcache jcache

Looking at the Ehcahce implementation of net.sf.cache.JS107, I am trying to achieve the following code snippet to produce the JCache implementation as a Spring managed bean..