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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Internal Server Error for a Get Request as a service

Viswadeep
2-Guest

Internal Server Error for a Get Request as a service

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

1 ACCEPTED SOLUTION

Accepted Solutions

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?

View solution in original post

3 REPLIES 3
PaiChung
22-Sapphire I
(To:Viswadeep)

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?

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?
slangley
23-Emerald II
(To:Viswadeep)

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

Top Tags