There is asmx:
[WebService] [ScriptService] public class MyService : WebService { [WebMethod] public OperationResult Validate(string str) { } }
There https : //.../a.aspx, on this page I call webserivce via jQuery ajax:
$.ajax({ url: '/Services/MyService.asmx/Validate', type: 'POST', contentType: 'application/json; charset=utf-8', data: data, success: function (data, textStatus, xhr) {
Note that a.aspx uses HTTPS . Ajax request will receive 401 Unauthorized response. If a.aspx does not use HTTPS, it works.
I use a library called "WebPageSecurity", if I use it, error 401 will occur. If I do not use it, then there is a direct occurrence of https: //.../a.aspx in the browser, then it will work. So I think the problem is in WebPageSecurity, how can I fix it? Thanks.
source share