i have a simple website that includes a WebService and a Webform page.
i'm trying to call my web service from the web form using jquery.
when i type the web service's url using https, i get "Access denied" error from internet explorer.
the call works just fine when i type http...

my service code:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WebService : System.Web.Services.WebService { 

    [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
    public string HelloWorld(int i) {
        return "Hello World";

my client code:

            type: "POST",
            contentType: "application/json",
            url: "https://localhost:56497/Cors/WebService.asmx/HelloWorld",
            data: "{i:4}",
            dataType: 'json',
            success: function (data) {                
            error: function (err) {                

i have also tried the following configuration in web.config:

   <add name="Access-Control-Allow-Origin" value="*" />
   <add name="Access-Control-Allow-Headers" value="Content-Type" />

nothing seems to work

Recommended Answers

All 2 Replies

i get "Access denied" error from internet explorer.

Have you configured the web server to listen/accept connections on port 443 and the took care of the installation of the digital certificate?

I defined the project in IIS with port 443 binding, however i dont have the option to install a certificate, instead i used a "self signed" sertificate that can be created from IIS

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.