简体   繁体   English

.NET Compact Framework-“离线Web服务”支持

[英].NET compact framework - “offline webservices” support

I have a Win Mobile 6.0 .NET CF application that uses a reference to a WebService in order to call web methods on it. 我有一个Win Mobile 6.0 .NET CF应用程序,该应用程序使用对WebService的引用以便在其上调用Web方法。 In normal situations where the device is in WLAN coverage, the web methods can be executed synchronously by the device. 在设备处于WLAN覆盖范围的正常情况下,Web方法可以由设备同步执行。 The issue is when the device goes off-line (no WIFI or GPRS coverage). 问题在于设备离线时(没有WIFI或GPRS覆盖)。 I want that the application can still operate but need to "buffer" web method calls so that all operations are stored locally and if the device goes online again, all pending web requests are executed on WebService. 我希望该应用程序仍然可以运行,但是需要“缓冲” Web方法调用,以便所有操作都存储在本地,并且如果设备再次联机,则所有待处理的Web请求都将在WebService上执行。 Is there any generic solutions for that in .NET CF? .NET CF中是否有任何通用解决方案? Or do I have to implement it manually? 还是我必须手动实施? The only think I can think of now is to extract the interface of WebService manually and implement custom implementation of it which checks whether WebService is available and in that case refer all web method call to the WebService proxy. 我现在唯一能想到的就是手动提取WebService的接口并实现其自定义实现,以检查WebService是否可用,在这种情况下,将所有Web方法调用都引用到WebService代理。 If WebService is not available (no Internet connection etc), then my custom implementation is called which stores are WebMethod calls locally (ie in a local file). 如果WebService不可用(没有Internet连接等),那么将调用我的自定义实现,这些存储是本地(即在本地文件中)WebMethod调用的。 Does .NET CF support some sort of transaction mechanism from WCF? .NET CF是否支持来自WCF的某种事务处理机制?

Thanks Dominik 谢谢多米尼克

link text There definitely isn't anything available out of the box to do this. 链接文本绝对没有开箱即用的功能可以做到这一点。 The behavior you're describing isn't a transaction behavior, but more of a guaranteed delivery behavior. 您描述的行为不是事务行为,而是更多的保证交付行为。 Microsoft has the Disconnected Service Agent Application Block as part of the desktop SCSF that addresses this type of scenario. Microsoft将“已断开服务代理程序”应用程序块作为解决此类情况的台式机 SCSF的一部分。

The Patterns and Practices team did do a scaled-down version of it in the Mobile Client Software Factory as the Offline Application Block ( sample here ), though be aware that a lot of the other stuff in the MCSF was ported from the desktop SCSF without any real thought about performance or memory on an embedded device and it therefore is really unusable on a real device (that's my nice way of saying it completely sucks). 模式和实践团队确实在Mobile Client Software Factory中将其按比例缩小了版本,作为“脱机应用程序块”( 此处样例 ),尽管请注意,MCSF中的许多其他内容是从台式机SCSF移植而来的,而没有关于嵌入式设备上性能或内存的任何真实想法,因此在真实设备上真的无法使用(这是我所说的完全糟透了的好方法)。 The OAB, though, appears to be a reasonable implementation and will probably do what you want. 但是,OAB似乎是一个合理的实现,并且可能会做您想要的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM