WCF 数据服务 +应用程序请求路由
当我们尝试使用与 ARR 一起使用的数据服务来更新/删除时,我们遇到了问题。
在 server1 中,我们有 ARR,它将调用路由到托管数据服务的 server2。
客户端连接到 server1 Url。
如果我们尝试使用 server1 Url 使用数据服务获取/添加新实体,它可以正常工作。使用 ARR 的 UrlRewrite 模块将调用转发到 server2。
但是,当我们尝试更新/删除实体时,数据服务层似乎知道从哪个服务器获取实体(ATOM feed 包含 server2 Url),因此它将消息直接发布到应用程序服务器。
在 Silverlight 中,这会导致跨域问题并且请求失败。
我无法得到任何帮助来解决这个问题。对于解决这个问题有什么建议吗?
有没有办法用 server1 url 覆盖来自 WCF DataServices 的 ATOM 提要响应中的 url?
We are facing issues when we try to update/delete using dataservices when used with ARR.
In server1 we have ARR which route the calls to server2 where the dataservices is hosted.
Client is connected to the server1 Url.
If we try to get/add a new entity using the dataservices using the server1 Url it works fine. The calls are getting forwarded to the server2 using UrlRewrite module of ARR.
But when we try to update/delete an entity, it looks like dataservices layer knows from which server the entity is fetched(ATOM feed contains the server2 Url), so it is posting the message directly to the app server.
In Silverlight this leads to cross domain issue and the request fails.
I couldn’t get any help in resolving the issue. Any suggestions for working around this issue?
Is there any way to overwite the url's in the ATOM feed response from WCF DAtaServices with server1 url?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可以利用出站规则来重写 wcf 数据服务响应返回的 URL,然后再到达客户端。
我在上述解决方法中遇到了一个问题。
由于客户端的对象物化失败,响应的内容长度未正确更新。
参考链接http://forums.iis.net/t/1178017.aspx我调整了缓冲区设置并使其正常工作。无法理解为什么缓冲区设置会影响内容长度标头。谁有更详细的信息请告诉我。
I could able to make use of outbound rules to rewrite the urls returned by wcf data services response before it reaches to the client.
I have face one issue in the above workaround.
The content lenght of the response is not getting updated properly due to this the object materialization at the client was failing.
After refering the link http://forums.iis.net/t/1178017.aspx I adjusted the Buffer settings and made it to work. Not able to understand on why the buffer settings is affecting the content-lenght header. Any one have any more details Please let me know.