Advanced Customization > Executing Info*Engine services with ODataConnector
  
Executing Info*Engine services with ODataConnector
ThingWorx Navigate now supports the OData Connector to execute Info*Engine tasks. If your custom tasks use Info*Engine tasks, use the OData connector to call these Info*Engine tasks.
The OData connector supports these Windchill releases:
11.1 M010 or later
11.1 F000 CPS03 or later
11.0 M030 CPS09 or later
* 
In the upcoming releases of ThingWorx Navigate, support for the Windchill connectors, ptc-windchill-connector and ptc-windchill-swagger-connector, will be deprecated. For a smooth transition to a release that does not have support for the old Windchill connectors, execute your Info*Engine tasks with ptc-windchill-OData-connector now, using the steps in this topic.
To use the OData connector to execute Info*Engine tasks, first configure the ptc-windchill-OData-connector to connect to the Info*Engine domain Windchill REST services. Then, you can use Windchill REST services to execute Info*Engine tasks.
* 
Make sure that you use the New Composer user interface in ThingWorx to configure the OData connector and to execute Info*Engine tasks.
You must configure Integration Runtime. For more information, see Set up Integration Runtime.
1. In ThingWorx Composer, search for ptc-windchill-OData-connector, and then open it. The General Information page opens.
2. Click Configuration. The Configuration page opens.
Your configuration depends on your authentication method: Single Sign-on, Windchill Authentication, or Fixed Authentication.
Single Sign-on
Follow these steps if you have Single Sign-on configured:
1. Under Generic Connector Connection Settings, for the Authentication Type, select SSO.
2. Under Authorization Server ID, enter the AuthorizationServerSettingsID value you provided in sso-settings.json, such as PingFed1.
3. Under Authorization Server Scopes Setting, click Add. The AuthorizationServerScopesSettings window opens.
4. Under Scope, enter the Windchill scope you registered in PingFederate, such as WINDCHILL_READ.
5. Click Add.
6. Under CSRF Settings, enter this information:
Relative URL For CSRF Get Requestservlet/odata
CSRF Token NameCSRF_NONCE
7. Under OData Connector Connection Settings, click Add. The ODataConnectorConnectionSettings window opens.
8. Under Service Root Relative URL, enter IE, and then click Add. Skip to step 9 if you already added the Service Root Relative URL.
9. Under HTTP Connector Connection Settings, enter this information:
Base URL—The Windchill URL. The URL must end with /oauth/. Use this format:
[https]://[Windchill Host]:[port]/[Windchill-web-app]/oauth/
This format specifies that the connection uses the OAuth standard and enables requests for data in the resource provider.
Relative URLservlet/odata
There’s no need to enter the user name and the password.
10. Click Save. The OData connector is now configured to work in your Single Sign-on environment.
Now, skip ahead to the section “Executing Info*Engine tasks”.
Windchill Authentication
Follow these steps if you have Windchill Authentication configured:
1. Under Generic Connector Connection Settings, for the Authentication Type, select None.
2. Under CSRF Settings, enter this information:
Relative URL For CSRF Get Requestservlet/odata
CSRF Token NameCSRF_NONCE
3. Under OData Connector Connection Settings, click Add. The ODataConnectorConnectionSettings window opens.
4. Under Service Root Relative URL, enter this value:
tw.friendly-name.ServiceRootReletive
Skip to step 6 if you already added the Service Root Relative URL.
5. Click Add.
6. Under HTTP Connector Connection Settings, enter this information:
Base URL—The Windchill server that receives the Info*Engine Request from the ODataConnector. Use this format:
[https]://[Windchill Host]:[port]/[Windchill-web-app]/sslClientAuth
Relative URLservlet/odata
Connection URL/servlet/WindchillGW/wt.httpgw.HTTPServer/ping
There’s no need to enter a user name and password.
7. Click Save.
8. Click Services.
9. Click GetCustomerHeaderParameters.
10. Click Edit.
11. Copy and paste this script in the input:

var sessionQueryParam = "wt.effectiveUid";
var Language = Resources["CurrentSessionInfo"].GetCurrentUserLanguage();

var params = {
infoTableName : "InfoTable",
dataShapeName : "NavigateCustomHeadersDataShape"
};
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);

var CurrentUser = Resources["CurrentSessionInfo"].GetCurrentUser();

params = {
tableName: "GenericConnectorConnectionSettings" /* STRING */
};
var configTable = me.GetConfigurationTable(params);

var row = configTable.getRow(0);
var authType = row.getStringValue("AuthenticationType");

if("None".equals(authType)) {
var camelHttpQuery = sessionQueryParam + "=" + CurrentUser;
row = {"Accept-Language" : Language, "CamelHttpQuery": camelHttpQuery };
} else {
row = {"Accept-Language" : Language };
}

result.AddRow(row);
12. Click Save and Continue, and then click Done.
13. Click Save.
Now, skip ahead to the section “Executing Info*Engine tasks”.
Fixed Authentication
If you have Fixed Authentication configured, follow the steps to configure the OData connector:
1. Under Generic Connector Connection Settings, for the Authentication Type, select Fixed.
2. Under CSRF Settings, enter this information:
Relative URL For CSRF Get Requestservlet/odata
CSRF Token NameCSRF_NONCE
3. Under OData Connector Connection Settings, click Add. The ODataConnectorConnectionSettings window opens.
4. Under Service Root Relative URL, enter IE, and then click Add. Skip to step 5 if you already added the Service Root Relative URL.
5. Under HTTP Connector Connection Settings, enter this information:
User name—Your Windchill administrator user name
Password—Your Windchill administrator password
Base URL—The Windchill server that receives the Info*Engine Request from the ODataConnector. Use this format:
[https]://[Windchill Host]:[port]/[Windchill-web-app]
Relative URLservlet/odata
6. Click Save. The OData connector is now configured to work in your Fixed Authentication environment.
Continue to the section “Executing Info*Engine tasks”.
Executing Info*Engine tasks
Now, execute the Info*Engine tasks with the service:
1. Click Services. The Services page opens.
2. For RefreshEndpointCache, click Execute. The Execute Service window opens.
3. Click Execute. You should receive the message: Success. Your service was successfully executed.
4. Click Done.
5. For InvokeIETask, click Execute.
6. In the Input window, add the following information in JSON format:
Task— The XML file for the Info*Engine task. The file is located here: <Windchill Installation>/<Windchill_Home>/tasks/.
* 
Make sure that the task is enabled for execution. To do this, verify that the following markup appears at the head of the XML file:
<%@page language="java" access="http"%>
Params—(Optional) A JSON array that contains name-value pairs to pass as a parameter to the Info*Engine task.
Example:
{
"Task": "wt/federation/delegates/windchill/QueryObjects.xml",
"Params": [
{ "Name": "type", "Value": "wt.part.WTPart" },
{ "Name": "where", "Value": "name=SOME_PART_NAME" }
]
}
7. Click Execute to start the Info*Engine task. The output of the service is in JSON format and contains the following properties:
@odata.context—The context URL for the payload.
Value—A JSON array that contains JSON objects with Groupname and Element properties.
8. To execute another Info*Engine task, repeat steps 1–7.
* 
The endpoints of the OData connector might not work as expected on ThingWorx Navigate, and as a result, you might need to make changes. For details and instructions on configuring OData services on Windchill data, see the Windchill REST Services User’s Guide.