0

hi
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)]
[ScriptService]
public class WebService : System.Web.Services.WebService { 

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

my client code:

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

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

<system.webserver>
 <httpprotocol>
  <customheaders>
   <add name="Access-Control-Allow-Origin" value="*" />
   <add name="Access-Control-Allow-Headers" value="Content-Type" />
  </customheaders>
 </httpprotocol>
</system.webserver>

nothing seems to work

2
Contributors
2
Replies
13
Views
4 Years
Discussion Span
Last Post by emilio
0

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?

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.