CReplicationServer.EnumRoutes Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Retrieves the replication routes that are defined on the Commerce Server Staging (CSS) server.

object EnumRoutes(ref object iterator)

Parameters

  • iterator
    Used by the CSS service to enumerate the list of routes. This value should be initialized to 0 (zero) and should not be modified.

Return Value

The CReplicationRoute object for this iteration.

Remarks

You must have CSS administrator or operator permissions to call this method.

This method sets e.ErrorCode to -1073680678 (“No routes defined.”) when there are no routes defined on the server. It sets e.ErrorCode to -2147422485 (“No more items.”) and returns an empty CReplicationRoute object to indicate the end of the enumeration.

The CReplicationServer.EnumRoutes method corresponds to the COM method named ReplicationServer.EnumRoutes.

Example

The following example displays the names of the routes that are defined on the content deployment server.

CReplicationServer replicationServer = new CReplicationServer();
  replicationServer.Initialize("");
  Console.WriteLine("The routes are:");
  int iterator = 0;
  object i = iterator as object;
  while (true)
  {
      try
      {
          CReplicationProject project = (CReplicationProject)replicationServer.EnumRoutes(ref i);
          Console.WriteLine(project.get_Name());
      }
      catch (System.Runtime.InteropServices.COMException e)
      {
          // Quit if "No more items" error
          if (e.ErrorCode == -2147422485)
              break;
          else
              throw e;
      }
  }

See Also

Other Resources

Routes

How to Manage Routes

How to Retrieve Project Information

How to Retrieve Staging Information

CReplicationServer.AddRoute Method

CReplicationServer.DeleteRoute Method

CReplicationRoute Class

CReplicationServer Class