Silverlight是否缓存Web服务调用? [英] Does Silverlight cache web service calls?

查看:109
本文介绍了Silverlight是否缓存Web服务调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是问题所在:

我的Silverlight应用程序正在使用WebClient(称为getCampaigns)调用HTTP Web服务,该服务返回Campaign对象的JSON数据数组.然后,用户可以与请求的对象进行交互,对其进行修改,将其删除等.当用户删除活动时,Silverlight会调用另一个Web服务,该服务会在数据库中标记该对象,以便将来不再返回该对象.然后通过调用getCampaigns刷新页面.问题是已删除的广告系列仍然显示.

My Silverlight application is calling a HTTP web service, using WebClient, called getCampaigns which returns a JSON array of data for Campaign objects. The user can then interact with the requested objects, modifying them, removing them, etc. When the user removes a campaign, Silverlight calls another web service, which flags the object in the database so it won't be returned in the future, and then refreshes the page by calling getCampaigns. The problem is the removed campaign still shows up.

如果我检查数据库,则该活动确实已被禁用,并且如果我关闭Silverlight应用程序并重新启动它,则该活动不会出现.看来Silverlight正在缓存Web服务调用.但是每次调用时都会实例化一个新的WebClient对象.

If I check the database, the campaign truly has been disabled, and if I close the Silverlight application and restart it, the campaign doesn't appear. It appears that Silverlight is caching the web service call. But each time the call is made a new WebClient object is instantiated.

有什么想法吗?

推荐答案

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=340931&wa=wsignin1.0

给出了两种解决方法.我将Guid附加到我的网址中,因此每个Web服务调用都是使用唯一的网址完成的.

Two workarounds are given. I'm appending a Guid to my Url, so each web service call is completed using a unique Url.

这篇关于Silverlight是否缓存Web服务调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆