Skip to main content
1-Visitor
October 27, 2020
Solved

How to call services of one thingworx in other thingworx?

  • October 27, 2020
  • 1 reply
  • 1946 views

Hi Team,

 

Suppose I want to call one common service of 5 ThingWorx Environments in one service of master ThingWorx environment (can say 6th environment) to see the result on any mashup in 6th environment.

 

Result on mashup in 6th enironment will be like :-

Env1---> ResultOfEnv1

Env2---> ResultOfEnv2

Env3---> ResultOfEnv3

Env4---> ResultOfEnv4

Env5---> ResultOfEnv5

 

What would be the solution?

 

Thanks in advance.

 

Best answer by ranjank

Hi @zyuan1 ,

 

Below solution has worked for me:-

PostJSON() is used for executing services and GetJSON() is used for getting property values of any other ThingWorx environment.

 

Atlast I have shown the result in of a responsive Grid on mashup

1 reply

5-Regular Member
October 27, 2020

2 ways.

1. Use REST API call to retrieve information

2. Federation settings, it can share Stream, Datatable information

https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx%2FHelp%2FComposer%2FFederation%2FFederation.html 

ranjank1-VisitorAuthor
1-Visitor
October 27, 2020

Hi @zyuan1 ,

 

Can you pls share the snippet of using REST API for accessing Things and Services of other environment ThingWorx so that I can have a try. 

5-Regular Member
October 29, 2020

I'm thinking about using Link widget in the mashup with a popup window, and the Link will navigate to the mashup from another TWX server.

 

While talking about requesting through services, I'm thinking about whether GetJson, LoadXML services could work, and put REST request in their content, and pharse the result back to infotables and strings.