C#WCF服务:Windows Phone 7 [英] C# WCF Services: Windows Phone 7

查看:74
本文介绍了C#WCF服务:Windows Phone 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我目前正在尝试制作一个Windows 7移动应用程序,该应用程序能够从数据库中为我的购物清单应用程序检索信息.我正在使用文本块显示我的信息.每个段将包含2个文本块,分别是商品的名称和商品的价格.这是我得到 ActionNotSupportedException 的步骤.

我不知道如何在我的移动解决方案ShopWCFClient中调用方法.我在Web解决方案中的OperationContract中使用了delcare方法.如何在移动解决方案中声明它?有人可以参考我的样品吗?

Hi all,

I''m currently trying to make a Windows 7 mobile app that is able to retrieve information from the database for my shopping list app. I am displaying my information using textblocks. Each segment would consist of 2 textblocks, which is the name of the item and the price of the item. The step that is that I am getting ActionNotSupportedException.

I do not know how to call the methods in my mobile solution, which is ShopWCFClient. I had delcare my methods inside the OperationContract in my web solution. How do I Declare it in my mobile solution? Anyone have any sample that I can refer to? Thanks!

推荐答案

您应该能够创建ShopWCFClient的实例,然后只需在其上调用Web服务上的方法即可.
You should be able to make an instance of ShopWCFClient and then just call the methods on it that are on your web service.
ShopWCFClient client = new ShopWCFClient();
var myData = client.GetData();


我将这样的在线Web服务用于我拥有的WP7应用程序,并且效果很好.如果需要,我可以稍后再寄给您样品;如果您给我Web服务的地址,我可以为您提供帮助.


I use an online web service like this for a WP7 app that I have and it works quite well. I can send you samples later if you want or can help you if you give me the address of the web service.


这篇关于C#WCF服务:Windows Phone 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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