У меня есть сервисный метод, когда звонок доходит до него, он показывает ошибку во всех браузерах Internet Explorer 8, Chrome и Firefox 8.0.1.
ошибка
OPTIONS http://abc/AddRating 405 (Method Not Allowed)
но мой сервисный метод выполняется в chrome и т.е. 8, но не в firefox mozila.
то есть ответы сети firebug
Response Headers view source
Allow POST
Content-Length 1565
Content-Type text/html; charset=UTF-8
Server Microsoft-IIS/7.5
X-Powered-By ASP.NET
Access-Control-Allow-Orig... *
Access-Control-Allow-Meth... POST, GET
Access-Control-Allow-Head... Origin, Content-Type, Accept
Date Wed, 23 Nov 2011 06:34:56 GMT
Request Headersview source
Host services.farooq.tv
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0.1) Gecko/20100101 Firefox/8.0.1
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection keep-alive
Origin http://localhost:7844
Access-Control-Request-Me... POST
Access-Control-Request-He... content-type
Pragma no-cache
Cache-Control no-cache
так выглядит мой код для функции.
function addService(comments) {
try {
// User details
var user = { "Id": 2007, "FirstName": "Ufone", "LastName": "", "EmailAddress": "ahmed.ali@vidizmo.com509" };
var ratingInfo = {
"Id": 0,
"TenantId": _settings.tenantId,
"UserId": user.Id,
"FirstName": user.FirstName,
"LastName": user.LastName,
"Rating": 0,
"EmailAddress": user.EmailAddress,
"Comments": comments,
"RatedObjectTypeInfo": { "Id": 2 },
"RatingTypeInfo": { "Id": 1 },
"MashupRatingInfo": { "MashupMetaInfoId": _settings.ratedObjectId },
"RatedObjectId": _settings.ratedObjectId,
"TotalCount": 0
};
// AddRating service Url.
var url = "http://abc/AddRating";
$.ajax({
type: "POST",
url: url,
data: JSON.stringify(ratingInfo),
contentType: "application/json",
timeout: 5000,
crossDomain: true,
success: function (success) {
if (success == true) {
$("#addCommentsTable").hide();
var sMsg = document.getElementById('successMsg');
sMsg.style.display = "block";
// Setting value of a global variable _settings.start to 0 inorder to call the service right from page 1.
_settings.start = 0;
// Calling Comment displaying Service.
service(_settings);
}
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr);
}
});
}
catch (err) {
alert(err);
}
}
Пожалуйста, кто-нибудь может помочь ?????