我有下面的代码,它通过WCF数据服务在我的"Activity“表/实体中添加了一个新的"activity”。现在,当我在Chrome和Firefox中运行这个程序时,一切都很好,但在IE10中,它会响应以下错误...
{"error":{"code":"","message":{"lang":"en-US","value":"An error occurred while processing this request."}}}下面是我的代码。
function addActivity( newActivity )
{
var newActivity = { ActivityName: newActivity };
var requestOptions = {
//headers: { "DataServiceVersion": "1.0" },
method: "POST",
requestUri: uriActivity,
data: newActivity
};
OData.request( requestOptions, AddSuccessCallback, AddErrorCallback );
}我还使用了下面的包,因为到目前为止我读到这里都是worth...Thanks。在此特别感谢您的意见。
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="datajs" version="1.0.3" />
<package id="jQuery" version="1.7.2" />
<package id="Microsoft.Data.Edm" version="5.0.1" />
<package id="Microsoft.Data.OData" version="5.0.1" />
<package id="Microsoft.Data.Services" version="5.0.1" />
<package id="Microsoft.Data.Services.Client" version="5.0.1" />
<package id="System.Spatial" version="5.0.1" />
</packages>痕迹看起来像这样..。
HTTP/1.1 400 Bad Request
Server: ASP.NET Development Server/11.0.0.0
Date: Mon, 09 Jul 2012 07:55:17 GMT
X-AspNet-Version: 4.0.30319
X-Content-Type-Options: nosniff
DataServiceVersion: 1.0;
Content-Length: 1159
Cache-Control: private
Content-Type: application/json;odata=verbose;charset=utf-8
Connection: Close
{"error":{"code":"","message":{"lang":"en-US","value":"An error occurred while processing this request."},"innererror":{"message":"A node of type 'EndOfInput' was read from the JSON reader when trying to read the start of an entry. A 'StartObject' node was expected.","type":"Microsoft.Data.OData.ODataException","stacktrace":" at Microsoft.Data.OData.Json.ODataJsonEntryAndFeedDeserializer.ReadEntryStart()\r\n at Microsoft.Data.OData.Json.ODataJsonReader.ReadEntryStart()\r\n at Microsoft.Data.OData.Json.ODataJsonReader.ReadAtStartImplementation()\r\n at Microsoft.Data.OData.ODataReaderCore.ReadImplementation()\r\n at Microsoft.Data.OData.ODataReaderCore.ReadSynchronously()\r\n at Microsoft.Data.OData.ODataReaderCore.InterceptException[T](Func`1 action)\r\n at Microsoft.Data.OData.ODataReaderCore.Read()\r\n at System.Data.Services.Serializers.EntityDeserializer.ReadEntry(ODataReader odataReader, SegmentInfo topLevelSegmentInfo)\r\n at System.Data.Services.Serializers.EntityDeserializer.Read(SegmentInfo segmentInfo)\r\n at System.Data.Services.Serializers.ODataMessageReaderDeserializer.Deserialize(SegmentInfo segmentInfo)"}}}发布于 2012-08-14 05:18:37
看起来我需要通过HTTP提供我的页面。从Windows加载它们不起作用,尤其是在涉及IE的情况下。
https://stackoverflow.com/questions/11386593
复制相似问题