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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

CORS issue with Thingworx and REST calls

drieder
15-Moonstone

CORS issue with Thingworx and REST calls

Hello everyone,

 

I am facing the famous CORS issue when making post calls from my java script to the Thingworx Server. To be specific, this is the error message: "...has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource."

 

I tried to add the CORS filter to the tomcat web.xml as described in this thread and I am still facing this problem. I am using the Trial-Version for Thingworx by the way.

 

Any ideas what could be the reason?

Any help is appreciated very much.

 

best Regards,
Dominik

4 REPLIES 4
ckaminski
13-Aquamarine
(To:drieder)

Hello, Dominik:

 

   Is it possible you can share the fragment you added to the web.xml?

 

Regards,

-Chris Kaminski

drieder
15-Moonstone
(To:ckaminski)

Hello @ckaminski ,

 

please excuse my late reply. Attached you can find the web.xml file.

 

Best Regards,

Dominik

ckaminski
13-Aquamarine
(To:drieder)

Hello,

 

  Sorry for the delay.  I assume you are not running Both CORS filter sections in the web.xml? 

 

  Are you able to confirm the CORS header is not being sent with a tool like Postman or CURL? 

 

Regards,

-Chris

ckaminski
13-Aquamarine
(To:drieder)

Hello, Dominik:

 

Is it possible you can share the fragment you added to the web.xml?

 

You can message it to me privately if you wish.

 

Regards, -Chris Kaminski

Top Tags