Service Instance

Site Recovery Manager methods take a managed object reference _this, which references the SessionManager used for making method calls. Programs obtain _this by retrieving content of the ServiceInstance, which is accomplished by creating a new managed object reference of type SrmServiceInstance.

C# code to create SrmServiceInstance

public SvcConnection(string svcRefVal)
{
...
_svcRef = new ManagedObjectReference();
_svcRef.type = "SrmServiceInstance";
_svcRef.Value = svcRefVal;
}

The Java code is similar to the C# code.

Java code to create SrmServiceInstance

private static final String SVC_INST_NAME = "SrmServiceInstance";
private static ManagedObjectReference SVC_INST_REF = new ManagedObjectReference();
...
SVC_INST_REF.setType(SVC_INST_NAME);
SVC_INST_REF.setValue(SVC_INST_NAME);
srmService = new SrmService();