0

我不确定这更多的是编码问题还是服务器设置问题......

在我们的生产站点上,我们遇到了特定于 Internet Explorer 10 的问题。

我正在使用 jQuery 对同一域上的 Web 服务进行 ajax POST,在 IE10 中我得到 401 响应,IE9 工作得很好。我应该提到我们在我们网站的另一个区域镜像了代码,它在 IE10 中运行良好。这两个区域之间的唯一区别是一个在子域下,另一个在根级别。www.my1stdomain.comportal.my2nddomain.com

这些服务器上的目录结构是:

\my1stdomain\webservice\name\service.aspx

\portal\webservice\name\service.aspx

\portal\and\my1stdomain\文件夹中,我有一个执行 ajax 调用的页面,两个页面是相同的。

$.ajax({
    type: 'POST',
    url: '/webservice/name/service.aspx/function',
    cache: false,
    contentType: 'application/json; charset=utf-8',
    dataType: 'json',
    data: '{ "json": "data" }',
    success: function() {

    },
    error: function() {

    }
});

我已验证服务器端两个文件夹的权限相同。我已经应用了放置<meta http-equiv="X-UA-Compatible" value="IE=9">强制兼容性视图的解决方法修复(将 IE 置于兼容模式修复了问题)。这似乎在 Windows 7 上的 IE10 中工作,但是 Windows 8 上的 IE 10 仍然看到同样的问题。这些页面是包含标题的经典 asp,也没有使用其他元标记。文档类型被指定为<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//" "http://www.w3.org/TR/html4/loose.dtd">在门户页面和<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">主域上。

更新1


我在服务器上使用 Microsoft Network Monitor 3.4 来捕获请求。我使用以下过滤器来捕获 401:

Property.HttpStatusCode.StringToNumber == 401

这是回应

- Http: Response, HTTP/1.1, Status: Unauthorized, URL: /webservice/name/service.aspx/function Using Multiple Authetication Methods, see frame details
    ProtocolVersion: HTTP/1.1
    StatusCode: 401, Unauthorized
    Reason: Unauthorized
  - ContentType:  application/json; charset=utf-8
   - MediaType:  application/json; charset=utf-8
      MainType:  application/json
      charset: utf-8

    Server:  Microsoft-IIS/7.0
    jsonerror:  true
  - WWWAuthenticate: Negotiate
   - Authenticate:  Negotiate
      WhiteSpace:  
      AuthenticateData: Negotiate
  - WWWAuthenticate: NTLM
   - Authenticate:  NTLM
      WhiteSpace:  
      AuthenticateData: NTLM
    XPoweredBy:  ASP.NET
    Date:  Mon, 04 Mar 2013 21:13:39 GMT
    ContentLength:  105
    HeaderEnd: CRLF
  - payload: HttpContentType =  application/json; charset=utf-8
     HTTPPayloadLine: {"Message":"Authentication failed.","StackTrace":null,"ExceptionType":"System.InvalidOperationException"}

这里真正突出的是

未经授权,URL:/webservice/name/service.aspx/function 使用多种身份验证方法

有了这个,我仍然很困惑为什么这只发生在 IE10 中,如果它是一个权限/身份验证问题。10 中添加了什么,或者我应该在哪里寻找其根本原因?

更新2


以下是来自 fiddler 的客户端计算机的标头(已删除服务器信息)

主要的

SESSION STATE: Done.
Request Entity Size: 64 bytes.
Response Entity Size: 9 bytes.

== FLAGS ==================
BitFlags: [ServerPipeReused] 0x10
X-EGRESSPORT: 44537
X-RESPONSEBODYTRANSFERLENGTH: 9
X-CLIENTPORT: 44770
UI-COLOR: Green
X-CLIENTIP: 127.0.0.1
UI-OLDCOLOR: WindowText
UI-BOLD: user-marked
X-SERVERSOCKET: REUSE ServerPipe#46
X-HOSTIP: ***.***.***.***
X-PROCESSINFO: iexplore:2644

== TIMING INFO ============
ClientConnected:    14:43:08.488
ClientBeginRequest: 14:43:08.488
GotRequestHeaders:  14:43:08.488
ClientDoneRequest:  14:43:08.488
Determine Gateway:  0ms
DNS Lookup:         0ms
TCP/IP Connect: 0ms
HTTPS Handshake:    0ms
ServerConnected:    14:40:28.943
FiddlerBeginRequest:    14:43:08.488
ServerGotRequest:   14:43:08.488
ServerBeginResponse:    14:43:08.592
GotResponseHeaders: 14:43:08.592
ServerDoneResponse: 14:43:08.592
ClientBeginResponse:    14:43:08.592
ClientDoneResponse: 14:43:08.592

    Overall Elapsed:    0:00:00.104

The response was buffered before delivery to the client.

== WININET CACHE INFO ============
This URL is not present in the WinINET cache. [Code: 2]

门户网站

SESSION STATE: Done.
Request Entity Size: 64 bytes.
Response Entity Size: 105 bytes.

== FLAGS ==================
BitFlags: [ClientPipeReused, ServerPipeReused] 0x18
X-EGRESSPORT: 44444
X-RESPONSEBODYTRANSFERLENGTH: 105
X-CLIENTPORT: 44439
X-CLIENTIP: 127.0.0.1
X-SERVERSOCKET: REUSE ServerPipe#7
X-HOSTIP: ***.***.***.***
X-PROCESSINFO: iexplore:7132

== TIMING INFO ============
ClientConnected:    14:37:59.651
ClientBeginRequest: 14:38:01.397
GotRequestHeaders:  14:38:01.397
ClientDoneRequest:  14:38:01.397
Determine Gateway:  0ms
DNS Lookup:         0ms
TCP/IP Connect: 0ms
HTTPS Handshake:    0ms
ServerConnected:    14:37:57.880
FiddlerBeginRequest:    14:38:01.397
ServerGotRequest:   14:38:01.397
ServerBeginResponse:    14:38:01.464
GotResponseHeaders: 14:38:01.464
ServerDoneResponse: 14:38:01.464
ClientBeginResponse:    14:38:01.464
ClientDoneResponse: 14:38:01.464

    Overall Elapsed:    0:00:00.067

The response was buffered before delivery to the client.

== WININET CACHE INFO ============
This URL is not present in the WinINET cache. [Code: 2]
4

0 回答 0