{"action":"created","issue":{"url":"https://api.github.com/repos/andrewmcgivery/angular-soap/issues/3","labels_url":"https://api.github.com/repos/andrewmcgivery/angular-soap/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/andrewmcgivery/angular-soap/issues/3/comments","events_url":"https://api.github.com/repos/andrewmcgivery/angular-soap/issues/3/events","html_url":"https://github.com/andrewmcgivery/angular-soap/issues/3","id":63155227,"number":3,"title":"CORS","user":{"login":"blakemcbride","id":6467584,"avatar_url":"https://avatars.githubusercontent.com/u/6467584?v=3","gravatar_id":"","url":"https://api.github.com/users/blakemcbride","html_url":"https://github.com/blakemcbride","followers_url":"https://api.github.com/users/blakemcbride/followers","following_url":"https://api.github.com/users/blakemcbride/following{/other_user}","gists_url":"https://api.github.com/users/blakemcbride/gists{/gist_id}","starred_url":"https://api.github.com/users/blakemcbride/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blakemcbride/subscriptions","organizations_url":"https://api.github.com/users/blakemcbride/orgs","repos_url":"https://api.github.com/users/blakemcbride/repos","events_url":"https://api.github.com/users/blakemcbride/events{/privacy}","received_events_url":"https://api.github.com/users/blakemcbride/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-20T04:09:59Z","updated_at":"2015-03-20T04:29:46Z","closed_at":null,"body":"He, I am attempting some cross-site SOAP services.  The services work fine.  I've been using them for years.  The back-end is Java/Tomcat-8.0.9.  I have spent many hours and I keep getting:\r\n\r\n    OPTIONS http://localhost:8084/Arahant/MainOps soapclient.js:190 SOAPClient._sendSoapRequestsoapclient.js:153 SOAPClient._onLoadWsdlsoapclient.js:142 xmlHttp.onreadystatechange\r\n    index.html:1 XMLHttpRequest cannot load http://localhost:8084/Arahant/MainOps. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:63342' is therefore not allowed access. The response had HTTP status code 403.\r\n    soapclient.js:331 Uncaught TypeError: Cannot read property 'getElementsByTagName' of nullsoapclient.js:331 SOAPClient._getElementsByTagNamesoapclient.js:198 SOAPClient._onSendSoapRequestsoapclient.js:187 xmlHttp.onreadystatechange\r\n\r\nTomcat's web.xml has the following:\r\n\r\n\t<filter>\r\n\t\t<filter-name>CorsFilter</filter-name>\r\n\t\t<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>\r\n\t\t<init-param>\r\n\t\t\t<param-name>cors.allowed.headers</param-name>\r\n\t\t\t<param-value>Content-Type,X-Requested-With,Accept,Accept-Encoding,Accept-Language,Cache-Control,Connection,Host,Pragma,Origin,Referer,User-Agent,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>\r\n\t\t</init-param>\r\n\t\t<init-param>\r\n\t\t\t<param-name>cors.exposed.headers</param-name>\r\n\t\t\t<param-value>Access-Control-Allow-Origin,Content-Length,Content-Type,Date,Server,Access-Control-Allow-Credentials</param-value>\r\n\t\t</init-param>\r\n\t</filter>\r\n\t<filter-mapping>\r\n\t\t<filter-name>CorsFilter</filter-name>\r\n\t\t<url-pattern>/*</url-pattern>\r\n\t</filter-mapping>\r\n\r\nThe JS code looks like this:\r\n\r\n\r\n        $soap.post('http://localhost:8084/Arahant/MainOps', 'getLoginProperties').then(function(response) {\r\n            var x = response;\r\n            var y = x;\r\n        });\r\n\r\n\r\nI have no idea what else to do.  If you could, I would sure appreciate it.\r\n\r\nThanks.\r\n\r\nBlake McBride\r\n"},"comment":{"url":"https://api.github.com/repos/andrewmcgivery/angular-soap/issues/comments/83901500","html_url":"https://github.com/andrewmcgivery/angular-soap/issues/3#issuecomment-83901500","issue_url":"https://api.github.com/repos/andrewmcgivery/angular-soap/issues/3","id":83901500,"user":{"login":"andrewmcgivery","id":4482878,"avatar_url":"https://avatars.githubusercontent.com/u/4482878?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewmcgivery","html_url":"https://github.com/andrewmcgivery","followers_url":"https://api.github.com/users/andrewmcgivery/followers","following_url":"https://api.github.com/users/andrewmcgivery/following{/other_user}","gists_url":"https://api.github.com/users/andrewmcgivery/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewmcgivery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewmcgivery/subscriptions","organizations_url":"https://api.github.com/users/andrewmcgivery/orgs","repos_url":"https://api.github.com/users/andrewmcgivery/repos","events_url":"https://api.github.com/users/andrewmcgivery/events{/privacy}","received_events_url":"https://api.github.com/users/andrewmcgivery/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T04:29:45Z","updated_at":"2015-03-20T04:29:45Z","body":"You're never actually setting the ```Access-Control-Allow-Origin``` header, just allowing it.\r\n\r\nYou're missing:\r\n\r\n```\r\n<init-param>\r\n        <param-name>cors.allowOrigin</param-name>\r\n        <param-value>*</param-value>\r\n</init-param>\r\n```\r\n\r\nand you might also need:\r\n\r\n```\r\n<init-param>\r\n        <param-name>cors.supportedMethods</param-name>\r\n        <param-value>GET, POST, HEAD, OPTIONS</param-value>\r\n</init-param>\r\n```"}}