Run Service method

Use the Run Service method to run a service. The service can be run without any changes. Alternatively, you can run the service with override values that are different from the values that are saved with the service.

HTTP method: POST

URI: /execute/connection_name/service_id

Request payload content type: application/xml

Response payload content type: application/xml

Expected response: HTTP/1.1 201 Created

Parameters

The method URI contains the following parameter(s):

Name Description Required
connection_name Enter the name that identifies the Optim™ directory connection that contains the service. Y
service_id Enter the service ID that identifies the service that you want to run. Y

Request payload example

The following example shows a request to run a service.
<?xml version="1.0" encoding="UTF-8"?>
<sem:serviceRequestExecutionInput 
 xmlns:sem="http://www.ibm.com/optim/xsd/sem/9.1.0" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://www.ibm.com/optim/xsd/sem/9.1.0 
 resource.xsd ">
   <rsiURL>http://servercomputer:12000/</rsiURL>
   <executedBy>jdoe</executedBy>
</sem:serviceRequestExecutionInput>

The following example shows a request to run the service from the first example with override values.

  1. Create a override file with the overrides you want to pass. Refer to documentation on the override keywords: Override Keywords.

    For example a file extract_overrides.txt was created for extract request and a override was added which uses a file macro: XFFILE "C:\IBM\InfoSphere\Optim\temp\data\db2_test.sales_<$SEQ>.xf"

  2. Pass the override file path in the payload.
    <?xml version="1.0" encoding="UTF-8"?>
    <sem:serviceRequestExecutionInput 
     xmlns:sem="http://www.ibm.com/optim/xsd/sem/9.1.0" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://www.ibm.com/optim/xsd/sem/9.1.0 
     resource.xsd ">
       <rsiURL>http://servercomputer:12000/</rsiURL>
       <overrideFilePath>C:\IBM\InfoSphere\Optim\temp\extract_overrides.txt</overrideFilePath>
       <executedBy>jdoe</executedBy>
    </sem:serviceRequestExecutionInput>

Response payload example

The following example shows the response that confirms that the service was started.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:executionResults xmlns:ns2="http://www.ibm.com/optim/xsd/sem/9.1.0">
    <executionId>fbf1cdd5-bdf7-4682-96ad-722672af0001</executionId>
    <requestType>com.ibm.nex.model.oim.distributed.ExtractRequest</requestType>
    <origin>WEB_SERVICES_BRIDGE</origin>
    <returnCode>0</returnCode>
    <proxyUrl>http://servercomputer:12000/</proxyUrl>
</ns2:executionResults>

Response codes

The following response codes can be received when the method is complete:

Response code Description
202 Accepted. The service request was processed and accepted. This response code does not mean that the service request completed successfully.
400 Bad Request. A malformed request was submitted.