silverlight   发布时间:2022-05-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Silverlight调用WCF服务大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

  When creating a WCF Service Application for your Silverlight application you will encounter a "cross domain" error with default configurations.   Below I show the default Service application code (o

 

When creating a WCF Service Application for your Silverlight application you will encounter a "cross domain" error with default configurations.  

Silverlight调用WCF服务

Below I show the default Service application code (only class name changed) and made the necessary Silverlight WCF configuration change for basicHttpBinding as shown by the arrow. 

Silverlight调用WCF服务

I then created a Web Service reference for both my Silverlight application and Test application.  Note that Silverlight uses Async calls while the Test project uses Sync call to obtain data.

Silverlight调用WCF服务

When I run the Silverlight application I get the following error:

Silverlight调用WCF服务

I added the following clientaccesspolicy.xml file per THIS LINK (you can copy code from it) to my WCF Service and both my Silverlight and Unit test run without issue.

 

Silverlight调用WCF服务

大佬总结

以上是大佬教程为你收集整理的Silverlight调用WCF服务全部内容,希望文章能够帮你解决Silverlight调用WCF服务所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: