Appendix > Installing the Remote API > To start a new Windchill Requirements Connector application on the server
To start a new Windchill Requirements Connector application on the server
The client can communicate with the Windchill Requirements Connector service running on the server via TCP-IP. The client has to know the host name and the port on which the service is running (which is configured on the server via the environment variable WRC_API_SERVICE_PORT). The Windchill Requirements Connector service provides a number of services such as starting and stopping a Windchill Requirements Connector instance, as well as requesting information about one or all running Windchill Requirements Connector instances. See the Java example below:
String SERVER_HOST = "192.168.11.77";
int SERVICE_PORT = 5555;

int APPLICATION_PORT = 5678;
String WORKSPACE_PATH = "C:/ApiTests/TestData/Workspace";

// establish a connection to the WRC service on the server
IRemoteServiceClient serviceClient = RemoteClientFactory.createRemoteServiceClient
(SERVER_HOST, SERVICE_PORT);
if(!serviceClient.requestNewExerptInstance("some_id", APPLICATION_PORT,
WORKSPACE_PATH)) {
throw new Exception("Unable to start a new instance");
}

// get instance information
IInstanceInformation info = serviceClient.getInstanceInformation("some_id");

System.out.println("ID: ".concat(info.getId()));
System.out.println("Port: ".concat(info.getPort()));
System.out.println("Start time: ".concat(info.getStartTime()));
System.out.println("Workspace: ".concat(info.getWorkspace()));
System.out.println("Status: ".concat(info.getStatus()));

// stop the instance
serviceClient.killInstance("some_id");

// get a list of instances running on the server
IInstanceInformation[] infos = serviceClient.getAllInstanceInformation();

for (IInstanceInformation aInfo : infos) {
System.out.println("ID: ".concat(aInfo.getId()));
System.out.println("Port: ".concat(aInfo.getPort()));
System.out.println("Start time: ".concat(aInfo.getStartTime()));
System.out.println("Workspace: ".concat(aInfo.getWorkspace()));
System.out.println("Status: ".concat(aInfo.getStatus()));
}
Was this helpful?