Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

How to enable SOAP request from javascript?

  • 3 பதிலளிப்புகள்
  • 3 இந்த பிரச்னைகள் உள்ளது
  • 13 views
  • Last reply by Mahdi Dibaiee

i am developing a simple script for accessing a web-service. I do a request from my javascript, but firefox blocks this request and in console writes "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.guru4.net/articoli/javascript-soap-client/demo/webservicedemo.asmx?wsdl. This can be fixed by moving the resource to the same domain or enabling CORS." How to enable this damn CORS in firefox?

i am developing a simple script for accessing a web-service. I do a request from my javascript, but firefox blocks this request and in console writes "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.guru4.net/articoli/javascript-soap-client/demo/webservicedemo.asmx?wsdl. This can be fixed by moving the resource to the same domain or enabling CORS." How to enable this damn CORS in firefox?

NoahSUMO மூலமாக திருத்தப்பட்டது

All Replies (3)

It's not about enabling CORS in Firefox, relax.

CORS must be enabled at the server-side, this is an error for security, Every browser throws this error.

In order to activate CORS in your server you must send these headers:

    Access-Control-Allow-Origin: <yourUrlToAllowAccess>

More about this at MDN

+ Please test your code on other browsers before acting like this, if it's the same across browsers, stackoverflow is the place to ask your question.

Mahdi Dibaiee மூலமாக திருத்தப்பட்டது

hmmm, does it mean that my client is forbiddent to access this server? I am not related to this server and cannot to reconfigurate it. I can access this web-service http://www.guru4.net/articoli/javascript-soap-client/demo/webservicedemo.asmx?wsdl using wsdl-browser http://wsdlbrowser.com/, but it doesn't work when I invoke this service from my javascript-code

Yes, the server has disabled CORS, that's why you can't access it using JavaScript. You can open it with any browser, but you can't access it from another origin ( i.e. your website )

Mahdi Dibaiee மூலமாக திருத்தப்பட்டது