Link to home
Start Free TrialLog in
Avatar of srikotesh
srikotesh

asked on

Unable to call rest service calls causing the issue like Cross-Origin Request Blocked

Hi Experts,

I am facing cross origin issue when calling rest services.
Error:
This site makes use of a SHA-1 Certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than SHA-1.[Learn More] /

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://lab.Test.com:7443/UtilAction/activitycode/AFC-APPROVE?_=1473946914616. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

How to resolve this issue?
I am using angularjs,java,restwebsevices,tomcat server.

Thanks,
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

You need to put a header directive on the REST service

Access-Control-Allow-Origin: *

* can be replaced with a domain name or IP address if you need to be more granular.

Refer to this article for more information
https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

This article also gives a very in detail description of the CORS process
http://www.html5rocks.com/en/tutorials/cors/
Avatar of srikotesh
srikotesh

ASKER

I will provide the answer. how I am done through java.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.