如何从Silverlight项目中调用WCF服务 [英] How to call a wcf service from silverlight project

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

问题描述

朋友们,
我有一个简单的应用程序,我想使用wcf服务访问数据库.我知道在普通的Windows应用程序中会做,但在银色的情况下会有所不同.

我已经完成了将服务引用添加到我们的Silver Light项目中"的常规Windows方法,但是当我创建该服务的对象时,该服务中的方法(我已经在wcf服务中声明了add())未显示在我的白银中轻型应用.

我正在使用Silver Light 4和Visual Studio 2010

朋友,请提供给我一个解决方案,或者只是在显示确切步骤的地方张贴网站地址.

在此先感谢
Ganesh

Hi friends,
I have a silver light application and i want to access a database using wcf services. I know doing in normal windows application but in silver light it is some what different.

I have done the normal windows method of "adding service reference to our silver light project" but while i create a object to the service the methods in that service (which i have declared in wcf service add()) is not showing in my silver light application.

I am using silver light 4 and Visual Studio 2010

Friends Please provide me a solution or just post the site address where exact procedure shows.

Thanks in Advance
Ganesh

推荐答案

Silverlight应用程序只能将请求发送到同一服务器上的Web服务.因此,如果silverlight应用程序托管在http://MyDevComputer上,则Web服务也大多数托管在http://MyDevComputer上.

也许可以帮忙
使用Silverlight消费WCF服务的4个简单步骤 [
A Silverlight application can only send requests to a webservice on the same server. So if the silverlight application is hosted on http://MyDevComputer then the webservice most be hosten on http://MyDevComputer as well.

And maybe this can help
4 Simple Steps to Consume WCF Service using Silverlight[^]
I haven''t read the article, but I respect the author so I believe it''s good if not great :)


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

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