This procedure describes how to send a request using the EMXMLInvoker or EMBasicXMLInvoker. The invoke method can throw an exception if the application fails to process the invoke call (for example, if communication between Control‑M/EM and Control‑M fails). For more information, see Application runtime and communication troubleshooting.
To send a request:
GSRComponent gsrComponent = new GSRComponent();
EMXMLInvoker gsrInvoker = new EMXMLInvoker(gsrComponent);
GSRComponent gsrComponent = new GSRComponent();
EMBasicXMLInvoker gsrInvoker = new EMBasicXMLInvoker(gsrComponent);
NOTE: In networks in which more than one GUI Server is installed, only the component is listed in the ctmemapi.properties file. The API works only with the components listed in the file. You cannot modify the file to include more than one GUI Server.
String xmlRequest = "<?xml?>..."; // xml request
String xmlResponse;
try{
xmlResponse = gsrInvoker.invoke(xmlRequest);
}
catch(InvokeException ex){
// handle invoke failures
}
// handle xml response
NOTE: A request in XML format (xmlRequest), specifying the action that the Control M installation is to perform, is required for each call. The various types of requests that you can make are described in Request and response parameters.
Parent Topic |