When you generate a task interface object, a task file is always generated regardless of your other selections. Task files are XML interface objects that implement the IConnectorAccess interface. They are used either directly by your application, or internally by the Runtime Service when you develop applications that use another type of task interface object.
Description |
Example |
Instantiate the connector class for your Synapta Services Builder. The examples create the instance "myconnector." |
IMSConnectorAccess myconnector = new
IMSConnectorAccess(); |
Initialize your connector by opening your task file. The argument is the path to the file. |
myconnector.open (path\to\my_connector.xml); |
Get the metadata for your task. If the task id is -1, then all tasks are returned. |
String xmlString = myconnector.getMetaData(-1); |
Optionally, set a timeout for the task execution. The default is "-1", indicating no timeout is set. |
myconnector.setTimeOut("-1"); |
Optionally, set the maximum return data size. The default is -1, indicating all data is returned. |
myconnector.setMaxSize(-1); |
Execute the task. The argument is the task id and the task inputs as xml. |
myconnector.execute(task_id, inputXML); |
Retrieve the data. |
String outputXML = myconnector.getData
(task_id); |
Close the runtime service. |
myconnector.close(); |