Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error when consuming SOAP webservice in java Script..

Former Member
0 Likes
834

Hi Experts,

Please need a help when I am consuming web service in java script.

Error: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

Thanks in advance.

1 REPLY 1
Read only

Katan
Active Participant
0 Likes
449

It's a CORS error and in a nutshell, it looks like you may not have included 'Access-Control-Allow-Origin' in your request header.  So I would try this first. 


Secondly your server may not accept cross origin requests.  You may need to get the domain of your originating site added to the list of acceptable domains on that server for requests to that service.  I think it also rejects changes in protocol as cross origin, so HTTP making a HTTPS request is not allowed.  So watch out for that.   

You can find out a bit more about over here

Same-origin policy - JavaScript | MDN

https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS

It may just be a problem, if you are testing on a local deployment as your local host will definitely be defined. 

Hope that makes sense.  If you are working in JS and using AJAX, you need to understand this, so take the time to.

Regards

Katan