如何从Silverlight应用程序调用WCF服务 [英] How to call a WCF service from silverlight application

查看:93
本文介绍了如何从Silverlight应用程序调用WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我的Silverlight应用程序中,我需要调用WCF服务.我必须传递一个字符串变量作为输入,并从WCF服务返回一个数组列表.

如果有人对如何调用WCF服务或将性能参数传递给WCF服务有任何想法,请给我答复.

感谢Advance.

解决方案

如果使用的是Visual Studio 2008,则需要安装Silverlight Tool for Visual Studio.安装后,您将在新建项目"对话框中看到Silverlight项目模板.

1.选择Silverlight应用程序,然后选中用于承载Silverlight的ASP.NET项目的复选框.

2.在ASP.NET

3中添加启用Silverlight的WCF服务.编写带有参数的方法,然后返回所需的数组列表.

4.生成ASP.NET项目

5.将此服务添加为Silverlight项目中的服务参考.

6.然后,您将能够看到在启用Silverlight的WCF服务中编写的方法.


希望它会有所帮助.搜索结果
阅读文章和下载示例应用程序从我blog.This会帮助你,

带有WCF服务的Silverlight [ 解决方案

If you are using Visual Studio 2008, you need to install Silverlight Tool for Visual Studio. You will see the Silverlight Project template in "New Project" dialog after installation.

1. Chose Silverlight Application and check the check box for ASP.NET project for hosting Silverlight.

2. Add Silverlight-Enabled WCF service in ASP.NET

3. Write a method with parameter and return the array list that you want.

4. Build the ASP.NET project

5. Add this service as a service reference in Silverlight project.

6. then, you will be able to see the method that you write in Silverlight-Enabled WCF service


Hope it helps.


Read Article and Download sample application from my blog.This will help you,

Silverlight with WCF Service[^]


这篇关于如何从Silverlight应用程序调用WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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