Invoke method

To invoke an IDO method remotely, on a specified target site, use the Invoke method.

The Invoke remote IDO method is equivalent to the RemoteMethodCallSp stored procedure that is used to call another stored procedure at a remote site. However, instead of supporting only stored procedures, this method also supports IDO methods, using extension class code.

Note: This method does not return any values from the remote method being called. To do that, use the InvokeTransactional method or the LoadCollection method.

Transaction or Delayed Replication?

This method can be used for both Transactional and Delayed Replication interval types, as defined in the replication rules.

For transactional replication, this method reuses the connection of the current site. By switching the context to point to the target site, it executes the code remotely at the target site. If the target site is the same as the source site, no alternate context is created, and the method executes directly to the current context of the source site.

Note: Support for Distributed Transaction Coordinator (DTC) is not included, because the transactional IDO method call is performed using the same connection as the current site and by switching the context of the current site into the target site.

For delayed replication, this method executes the RemoteMethodCallSp stored procedure, to stage the request data into the replication tables (for example, ReplicatedRows3_mst and ShadowValues). Then the Replicator service checks the replication tables, retrieves any existing rows, and queues the request to the MSMQ. The Replication Queue Listener service then checks the Queue Server (MSMQ) to determine whether there are any queued messages to be transformed. If there are any such messages, the Replication Queue Listener service transforms the request and handles the IDO method call at the remote site.

Parameters required by this method

To be used correctly, these are the parameters that this method requires:

Parameter Data Type Description
Target Site System.String This is the name of the site where the IDO method is to be called.
IDO Name System.String This is the name of the IDO on the target site where the remote IDO method resides.
Method Name System.String This is the name of the IDO method that is to be called at the target site.
Parameters Correspond to the data types of the arguments to be passed, as expected by the remote method This is a list of a variable number of arguments to be passed to the IDO method being called.

This example invokes an IDO method at a remote site:

var targetSite = "CA";
var idoName = "Products";
var idoMethodName = "ProcessProductStatus";
var arg1 = 100001;
var arg2 = "Product1";

//Call the IDO method into the specified target site.
RemoteMethod.Invoke( targetSite, idoName, idoMethodName, arg1, arg2 );