Skip to main content
1-Visitor
June 11, 2019
Solved

Windchill swagger connector service invocation

  • June 11, 2019
  • 2 replies
  • 3331 views

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.

Best answer by MarekP.Nowaczyk

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.

2 replies

Support
June 18, 2019

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

 

 

Support
June 27, 2019

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

ot5501-VisitorAuthor
1-Visitor
June 29, 2019

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

Support
July 17, 2019

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