Ado.net dataservices BeginExecuteBatch 调用适用于生产服务器上的开发失败,对象与目标类型不匹配

发布于 2024-08-25 18:11:43 字数 1347 浏览 2 评论 0原文

我们有一个 ado.net dataservices 1.0 调用,该调用通过 BeginExecuteBatch 作为批处理传递到 [WebGet] 服务操作。

一切都在我们的开发服务器上完美运行 - 我们将项目配置为使用 IIS 而不是 cassini Web 服务器,以使其尽可能接近我们的生产服务器。

当我们发布到生产服务器时,除了批处理调用之外,所有服务操作都可以正常工作,批处理调用会失败并显示 对象与目标类型不匹配。 。我一直无法找到任何原因。

我什至可以通过复制批处理中使用的 URL 并将其粘贴到浏览器中,对 [WebGet] 服务运行单个非批处理样式 GET 操作。

我无法找到任何信息来帮助我解决这个问题 - 任何指导将不胜感激。

谢谢, Mike M.

来自 Fiddler 的错误消息:

HTTP/1.1 500 内部服务器错误 内容类型:application/xml 数据服务版本:1.0;

<代码> 处理此请求时发生错误。 对象与目标类型不匹配。 System.Reflection.TargetException 在 System.Reflection.RuntimeMethodInfo.CheckConsistency(对象目标) 在System.Reflection.RuntimeMethodInfo.Invoke(对象obj,BindingFlags invokeAttr,Binder活页夹,Object []参数,CultureInfo文化,布尔skipVisibilityChecks) 在System.Reflection.RuntimeMethodInfo.Invoke(对象obj,BindingFlags invokeAttr,Binder活页夹,Object []参数,CultureInfo文化) 在System.Data.Services.RequestUriProcessor.CreateFirstSegment(IDataService服务,字符串标识符,布尔checkRights,字符串queryPortion,布尔& crossReferencingUrl) 在 System.Data.Services.RequestUriProcessor.CreateSegments(String[] 段,IDataService 服务) 在System.Data.Services.RequestUriProcessor.ProcessRequestUri(Uri绝对RequestUri,IDataService服务) 在 System.Data.Services.DataService`1.BatchDataService.HandleBatchContent(流响应流)

We have an ado.net dataservices 1.0 call that is being passed to a [WebGet] service operation as a batch through BeginExecuteBatch.

Everything works perfectly on our development server - we have the project configured to use IIS instead of the cassini web server to make it as close to our production server as we can.

When we publish to the production server, all the service operations work perfectly except the batch call, which fails with Object does not match target type. . I have not been able to find any cause for this.

I can even run a single non-batch style GET operation against the [WebGet] service by copying the URL used in the batch and pasting it in a browser.

I have not been able to find any information to help me solve this - any guidance would be most appreciated.

Thanks,
Mike M.

Error message From Fiddler:

HTTP/1.1 500 Internal Server Error
Content-Type: application/xml
DataServiceVersion: 1.0;


An error occurred while processing this request.

Object does not match target type.
System.Reflection.TargetException
at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Data.Services.RequestUriProcessor.CreateFirstSegment(IDataService service, String identifier, Boolean checkRights, String queryPortion, Boolean& crossReferencingUrl)
at System.Data.Services.RequestUriProcessor.CreateSegments(String[] segments, IDataService service)
at System.Data.Services.RequestUriProcessor.ProcessRequestUri(Uri absoluteRequestUri, IDataService service)
at System.Data.Services.DataService`1.BatchDataService.HandleBatchContent(Stream responseStream)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

っ〆星空下的拥抱 2024-09-01 18:11:43

我发现你不能批量进行函数调用。您只能进行实体查询。最烦人的。它可能已在更高版本中修复。

I found that you can't do function calls in a batch. You can only do entity queries. Most annoying. It may have been fixed in a later version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文