Windows Mobile 同步服务可以使用业务层吗

发布于 2024-09-01 12:56:12 字数 237 浏览 1 评论 0原文

我们正在构建一个 Win Mobile 6 仓库应用程序,它需要更新我们基于服务器的企业数据库。

我们的应用程序服务器上有一个 C# 业务层,我们真的希望我们的仓库应用程序能够经历这个过程。

我们也喜欢 MS 同步服务。

有没有办法将两者结合起来,即我们可以使用同步服务但让它们通过我们的业务层吗?有没有人这样做过并有一个我可以遵循的例子?对于这种情况有最佳实践吗?

谢谢,

安迪

We're building a Win Mobile 6 warehouse app which needs to update our server based corporate DB.

We've got a C# business layer that sits on our app server and we'd really like our warehouse app to go through this.

We also like MS Synch Services.

Is there a way to combine the two ie can we use sync services but get them to go through our business layer ? Has anyone done this and got an example I can follow ? Is there a best practice for this kind of scenario ?

Thanks,

Andy

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

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

发布评论

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

评论(1

写给空气的情书 2024-09-08 12:56:12

通过覆盖应用更改来实现它:
服务器端(即PFS.WarehouseHandheld.SyncServiceLibrary)
1. 在 SyncServiceLibrary 中,创建一个新的 SyncContract 实现。

  1. 新的 SyncContract 继承了生成的 SyncService(因此实现了 IXXXSyncService WCF 接口。)

  2. 在此新实现中,重写ApplyChanges以拦截推送到服务器的更改,循环传递参数dataSet中详细的更改,确定从dataSet.Tables[i].TableName更改的表。

  3. 从表中的每一行中提取适当的 DTO将其推入适当的 BLL 控制器。

  4. 在库的 app.config 中,插入另一个 system.serviceModel/services/service。这应该与生成的合约实现的原始服务节点相同,但名称不同。

客户端(即CF/windows mobile)
1. 将 Web 引用添加到您的新服务(我们的服务称为 PFSDatastore2CacheWebRefBLL)&按照上面演练中的指示对其进行破解,以删除重复的生成代码。

  1. 在您的同步调用代码中,引用新的 BLL 驱动服务(即 _webSvcProxy = new PFSDatastore2SyncServiceBLL();)并按照以前的方式执行操作。

详细信息请访问 http://handhelddeveloper.wordpress.com /2010/05/18/sync-thru-your-business-layer/

Got it going by overriding apply changes:
Server side (ie PFS.WarehouseHandheld.SyncServiceLibrary)
1. In the SyncServiceLibrary, create a new SyncContract implementation.

  1. The new SyncContract inherits the generated SyncService (& so implements the IXXXSyncService WCF interface.)

  2. In this new implementation, override ApplyChanges to intercept changes being pushed up to your server, loop thru changes detailed in passed param dataSet, determine table changed from dataSet.Tables[i].TableName.

  3. Hydrate the appropriate DTO from each row in the table & push it thru your appropriate BLL controller.

  4. In you library's app.config, plug in another system.serviceModel/services/service. THis should be the same as your original service node for the generated contract implementation but for a different name.

Client side (ie CF / windows mobile)
1. Add a web ref to your new service (ours is called PFSDatastore2CacheWebRefBLL) & hack it as directed in the walkthrough bove to remove duplicate generated code.

  1. In your Sync calling code, refer to the new BLL driven service (ie _webSvcProxy = new PFSDatastore2SyncServiceBLL();) and do as before.

Details at http://handhelddeveloper.wordpress.com/2010/05/18/sync-thru-your-business-layer/

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