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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Need an Urgent Help

kjain-2
15-Moonstone

Need an Urgent Help

Hi All,

 

Using Integrity Webservices but getting "Access-Control-Allow-Origin" issue. Please take a look over the issue :-

 

Failed to load http://blrmiespc-1233:7001/webservices/10/2/Integrity/?wsdl: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

 

Any help ?

 

Grube,

Kapil

3 REPLIES 3
awalsh
17-Peridot
(To:kjain-2)

Here's what I've been able to find: 

"If Web Services requests are being made from JavaScript code inside a web page (using XmlHttpRequest), the web page must be served up from the same machine that the Web Services calls are being made to. If this is not done, web browser security will deny the Web Services request on the grounds of cross-site scripting (XSS). The HTTP header "access-control-allow-origin" allows such requests to be made"

Workaround:

"Serve the web page containing the XmlHttpRequest code from the Integrity Server machine."

 

It seems that the web services does not (and cannot) define the "access-control-allow-origin" HTTP header. 

 

Note: Not a web services expert. Just quoting one 🙂

kjain-2
15-Moonstone
(To:awalsh)

Hi @awalsh,

 

First of all Thanks for your response.
I have written a single code just a HTML sample to check whether successful connection is made or not but getting this error again ..... And the code is on the server itself.

 

Can you please explain little more about this line "Serve the web page containing the XmlHttpRequest code from the Integrity Server machine." ?

 

Vielen Dank

Kapil Jain

 

 

Your HTML sample must be served by blrmiespc-1233 so it is same-origin. Also use the same name accessing it, not e.g. localhost or another alias for the name.
Announcements


Top Tags