我们有一个 asmx Web 服务,可以在 32 位 Windows Server 2008 上正常工作,但是当它托管在 64 位服务器 2008 r2 机器上时,它会给出“索引超出数组范围”。尝试访问服务的 javascript 文件时:
http://www.site.com/Service.asmx/js输出“索引超出了数组的范围。” 仅在 64 位托管时
服务代码如下所示:
[WebService(Namespace = "http://www.company.com")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
[ScriptService]
public class Saver : WebService
{
/// <summary>A web service to save a set of ScheduleEntryProperties objects.</summary>
[WebMethod]
public string SaveEntries(Entry[] entries, object start, object end, string assignmentIDs, string deptID, string useCodes)
{
...
}
和 Entry 对象:
[Serializable]
public class Entry
{
public Entry()
{
}
public Entry(object assignmentID, object date, object hours, object text)
{
AssignmentID = assignmentID;
Date = date;
Hours = hours;
Text = text;
}
public object Date;
public object AssignmentID;
public object Text;
public object Hours;
}
有任何想法吗?