0

我在 Chrome v19 上收到此错误。

我正在向 WCF 数据服务 5.1 rc 发出批处理请求

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<error xmlns="schemas.microsoft.com/.../metadata">
 <code></code>
 <message xml:lang="en-US">An error occurred while processing this request.</message>
 <innererror>
   <message>A supported MIME type could not be found that matches the content type of the response. None of the supported type(s) 'multipart/mixed' matches the content type 'application/xml'.</message>
   <type>Microsoft.Data.OData.ODataContentTypeException</type>
   <stacktrace>
     at Microsoft.Data.OData.MediaTypeUtils.GetFormatFromContentType(String contentTypeName, ODataPayloadKind[] supportedPayloadKinds, MediaTypeResolver mediaTypeResolver, MediaType& mediaType, Encoding& encoding, ODataPayloadKind& selectedPayloadKind)&#xD;
     at Microsoft.Data.OData.MediaTypeUtils.GetFormatFromContentType(String contentTypeHeader, ODataPayloadKind[] supportedPayloadKinds, MediaTypeResolver mediaTypeResolver, MediaType& mediaType, Encoding& encoding, ODataPayloadKind& selectedPayloadKind, String& batchBoundary)&#xD;
     at Microsoft.Data.OData.ODataMessageReader.ProcessContentType(ODataPayloadKind[] payloadKinds)&#xD;
     at Microsoft.Data.OData.ODataMessageReader.ReadFromInput[T](Func`2 readFunc, ODataPayloadKind[] payloadKinds)&#xD;
     at Microsoft.Data.OData.ODataMessageReader.CreateODataBatchReader()&#xD;
     at System.Data.Services.DataService`1.HandleBatchRequest()
   </stacktrace>
 </innererror>
</error>
4

1 回答 1

0

批处理请求的内容类型需要为“multipart/mixed”,并遵循以下格式:

OData.org 批量请求规范

批处理请求中的单个请求可以具有 json 格式,但批处理请求本身是上面链接中描述的特殊格式。

于 2012-11-27T15:45:49.573 回答