在Silverlight中更改WCF端点 [英] change WCF endpoint in silverlight

查看:153
本文介绍了在Silverlight中更改WCF端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在我的Silverlight应用程序中以编程方式更改WCF端点参数?

解决方案

以编程方式获取端点地址的最佳方法是通过创建端点.将当前URL传递给端点构造函数:

<br />
new Uri(Application.Current.Host.Source, "../MyService.svc");<br />



您的Web应用程序的根目录中存在"MyService.svc".

如果有帮助,请投票.


>>>错误:无法获得< asp:silverlight> default.aspx中的标记

这与WCF完全无关.

asp:Silverlight控件已弃用.

使用HTML或JavaScript将Silverlight添加到网页 [ ^ ]

我的意思是服务.我尝试了所有在google中找到的方法.但是不起作用(((((


How do I change the WCF endpoint parameter programmatically in my silverlight app?

解决方案

Best way to get the endpoint address programmatically is to create the Service Client by creating the endpoint. Pass the current url to the endpoint constructor:

<br />
new Uri(Application.Current.Host.Source, "../MyService.svc");<br />



Provided "MyService.svc" is present in the root directory of your web application.

Please vote for it if it helps you.


>>Error: can''t get <asp:silverlight> tag in default.aspx

That has absolutely nothing to do with WCF.

The asp:Silverlight control is deprecated.

Adding Silverlight to a Web Page by Using HTML or JavaScript[^]


I mean for a sevice. I tried all the way found in have googled. But don''t work(((


这篇关于在Silverlight中更改WCF端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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