我有一个webservice,并且在尝试进行post调用时仅从生产服务器收到以下错误。 它在开发服务器上运行良好!尝试在asmx webservice上进行post调用时发生错误
500 (Internal Server Error)
下面是Web服务
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class Getavailability : System.Web.Services.WebService {
.
.
}
这里头是客户端代码
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'WebServices/ServiceName.asmx/Method',
data: "{" +
"'fromDate': 'data'," +
"'fromTime': 'data'," +
"'toDate': 'data'," +
"'toTime': 'data'," +
"'flyingFrom': 'data'" +
"}",
cache: false,
success: function (data) {
//do something
}
});
服务器有IIS6和.NET 4
不任何人知道可能会导致这种情况?
我会感激任何评论
感谢
编辑
这是整个消息
{"Message":"Unable to connect to the remote server","StackTrace":"
atSystem.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at BLL.AbstractXML.GetXmlSR(String strURL, String queryStr)
at AvailabilityRQ.Get(DateTime fromDate, DateTime fromTime, DateTime toDate, DateTime toTime, String flyingFrom)
at Web.WebServices.Getavailability.Get(String fromDate, String fromTime, String toDate, String toTime, String flyingFrom)","ExceptionType":"System.Net.WebException"}
服务器上的错误有更多细节!你可以阅读它们的事件查看器,或者你可以打开错误,所以你可以在网页上阅读它,看看有什么不工作?在知道真正的错误之后,你不能很容易地解决这个问题。 – Aristos 2012-02-03 15:13:31
我从浏览器的开发工具收到错误,并不清楚。看到我编辑的帖子 – StrouMfios 2012-02-03 15:58:55
共享主机?大多数主机不允许任何种类的出站连接。 – 2012-02-03 16:04:58