Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
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.
Solved! Go to Solution.
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.
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
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
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.
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