cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Windchill swagger connector service invocation

ot550
7-Bedrock

Windchill swagger connector service invocation

We are having requirement of using windchill swagger connector (ptc-windchill-integration-connector).But we dont know how to invoke custom service in that connector for REST call,whether we need to write route or js service in that connector.We want output in the form of info-table. We tried as below but getting error :

 

 

var params = {
infoTableName : "InfoTable",
dataShapeName : "DataInfo"
};

// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(DataInfo)

var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
// result: INFOTABLE dataShape: "DataInfo"
result = Things["CDConnector"].Objects_Get_FindObjects({
$filter: 'state eq INWORK' /* STRING */,
typeId: 'wt.part.WTPART' /* STRING */,
navigationCriteria: undefined /* STRING */,
$select: 'objNumber,objName,version' /* STRING */
});

 

But getting error as 

 

Error executing service GetPobjects. Message :: Your route exchange has failed. HTTP operation failed with status [500 - 500] - See Script Error Log for more details.

ACCEPTED SOLUTION

Accepted Solutions

First of all you need to make sure that your Swagger Connector is configured correctly in ThingWorx by executing one of the "build in" service like for example SeavedSearch REST APIs.

If that works correctly then to execute any other Swagger REST API endpoints in Windchill, in ThingWorx you need to create a New API Map following documentation New API Map for the Service

 and test new service. The API Map is for the returned properties by the REST service.

View solution in original post

6 REPLIES 6
slangley
23-Emerald II
(To:ot550)

Hi @ot550.

 

Take a look at the ThingWorx Help Center to ensure your configuration is set up correctly.  Be sure to refer to the section on WindchillSwaggerConnector.

 

If you continue to have issues, please provide the logs located at \ThingworxStorage\logs.

 

Regards.

 

--Sharon

 

 

slangley
23-Emerald II
(To:slangley)

Hi @ot550.

 

If the previous response allowed you to solve your issue, please mark it as the Accepted Solution for the benefit of others on the community.

 

Regards.

 

--Sharon

ot550
7-Bedrock
(To:slangley)

Can you please provide how to write (inocation) test java script service in windchillswaggercpnnector to call a rest call from windchill side

First of all you need to make sure that your Swagger Connector is configured correctly in ThingWorx by executing one of the "build in" service like for example SeavedSearch REST APIs.

If that works correctly then to execute any other Swagger REST API endpoints in Windchill, in ThingWorx you need to create a New API Map following documentation New API Map for the Service

 and test new service. The API Map is for the returned properties by the REST service.

First you should execute RefreshEndpointCache connector build in service to refresh API cache. Then reproduce the issue by calling your API and gather logs from all endpoints to find our where the failure occurred.

Here is the route request from ThingWorx takes:

ThingWorx <=>IntegrationRuntime(IR)<=>WC ApacheHTTP <=> Windchill Server

 

Gather logs from all of them and look for your request to see at what point it failed and what was the error.

slangley
23-Emerald II
(To:ot550)

Hi @ot550.

 

If one of the previous responses answered your question, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Announcements


Top Tags