Skip to main content
1-Visitor
June 15, 2020
Solved

Internal Server Error for a Get Request as a service

  • June 15, 2020
  • 3 replies
  • 1396 views

Greetings, 

I am not able to do a simple GetJSON "Content Loader Function" for a service.

It shows 

 

Input:

 

 

 

var params = {
	url: "https://<Domain>/<call>",
};

var result = Resources["ContentLoaderFunctions"].LoadJSON(params);

 

 

Output was marked as a JSON output.

 

OutPut:

 Error executing service <servicename> : Message :: <RequestedDomain> - See Script Error Log for more details.

 

When I ping the same url in a browser I am able to get a JSON reply with Status Code 200

But when I try the same with thingworx service it is showing Status Code 500 in the inspect Window

 

Anyhelp on this would be very much appreciated..

 

Thank you

Regards

Viswa

Best answer by VladimirRosu_116627
You need more information to diagnose this:
-what kind of authentication mechanism does that webservice use?
-I assume you are replacing the <Domain> with the actual domain, like "www.ptc.com", right? I was not sure if what you wrote is exactly your call, or it's just redacted.
-are you sure that that domain can be solved by the ThingWorx server? When you execute this call in your browser it will use your DNS, while when executing it in the server it will use the ThingWorx server OS DNS. Maybe they are different?

3 replies

22-Sapphire I
June 16, 2020

Try it first as a GetText with a String return and see what is returned. From there work towards making it work as true JSON.

But the error seems to indicate some network issue, is our Thingworx server blocked from doing this request?

19-Tanzanite
June 16, 2020
You need more information to diagnose this:
-what kind of authentication mechanism does that webservice use?
-I assume you are replacing the <Domain> with the actual domain, like "www.ptc.com", right? I was not sure if what you wrote is exactly your call, or it's just redacted.
-are you sure that that domain can be solved by the ThingWorx server? When you execute this call in your browser it will use your DNS, while when executing it in the server it will use the ThingWorx server OS DNS. Maybe they are different?
Community Manager
June 24, 2020

Hi @Viswadeep.

 

If one of the previous responses allowed you to find a solution, please mark the appropriate one as the Accepted Solution for the benefit of others with the same issue.

 

Thank you for participating in our community!

 

Regards.

 

--Sharon