如何在Windows Phone 8上的应用程序与服务之间进行通信 [英] How to communicate between Application to Service on Windows Phone 8

查看:65
本文介绍了如何在Windows Phone 8上的应用程序与服务之间进行通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows Phone 8上编写服务和应用程序.该服务必须独立于正在运行的应用程序运行.每当启动应用程序时,它将请求服务收集一些数据并提供给应用程序.

1.服务与应用程序之间进行通信的最佳方式是什么

2.如何在Windows Phone 8模拟器上添加服务?

3.我可以为此获得任何示例代码吗?

4.可以使用套接字在服务和应用程序之间进行通信,还是只能选择使用RPC?为您的项目添加服务引用

,并且根据您的网络服务,您可以代表它.

wp8模拟器的行为完全类似于设备

选中此链接可能会有所帮助

http://blogs.msdn.com/b/joelcitizen/archive/2012/10/31/connecting-to-a-local-web-service-from-wp8-emulator.aspx 


I am trying to write a service and application on Windows Phone 8. The service has to run independent of the application running. Whenever the application is launched, it will request the service to gather some data and give to the application.

1. What is the best way to communication between in service and application

2. How can I add a service on Windows Phone 8 Emulator?

3. Can I get any sample code for this?

4. Can use sockets to communication between service and application or only the option is RPC?

解决方案

if you have a web service all what you need to add service reference to your project

and based on your webservice you can represent it.

The wp8 emulator acts exactly like the device

Check this link it might be helpful

http://blogs.msdn.com/b/joelcitizen/archive/2012/10/31/connecting-to-a-local-web-service-from-wp8-emulator.aspx 


这篇关于如何在Windows Phone 8上的应用程序与服务之间进行通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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