欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【Silverlight中动态获取Web Service地址】,下面是详细的讲解!
Silverlight中动态获取Web Service地址
public class ServiceUtil
{
public static string SVCPath { set; get; }
/// <summary>
/// Get Data Service path
/// </summary>
/// <returns>path</returns>
public static WorkflowServiceClient GetDynamicClient()
{
if (SVCPath==null)
throw new Exception("Wrong SVC Path!");
BasicHttpBinding binding=new BasicHttpBinding(Application.Current.Host.Source.Scheme.Equals("https", StringComparison.InvariantCultureIgnoreCase) ? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None);
binding.MaxReceivedMessageSize=int.MaxValue;
binding.MaxBufferSize=int.MaxValue;
return new WorkflowServiceClient(binding, new EndpointAddress(new Uri(Application.Current.Host.Source, SVCPath)));
}
}
关于Silverlight中动态获取Web Service地址的用户互动如下:
相关问题:ASP.NET Silverlight (银光) 如何通过WebService ...
答:如果是纯WebService(不用WCF,RIA之类的东西)的话: 1、服务端新建一个"web服务" : 鼠标停在*.web 项目上,右键->添加->新建项->web服务,向导会默认添加一个hello world 方法, 2、生成 *.web项目(否则客户端不能引用新加的服务) 3、在客户端(Sil... >>详细
相关问题:silverlight调用webservice问题
答:你用的如果不是OOB模式的话MyNew.Web工程是需要的,SilverLight要在Html页面中加载运行。 所以需要加载你卸载的那个Web工程并设为启动项目。 >>详细
相关问题:silverlight4或者5项目,数据读取使用webservice方...
答:你需要慢慢找一下。这里面也不太可能给你非常详细的答案。最好还是把webservice和silverlight部署到一个应用中,不然会有安全沙箱的问题,需要配置文件。另外,看看ria相关的文章,对你会有帮助的,比webservice好用许多,支持有限的linq语句。 >>详细
- 【asp】asp.net url重写浅谈-net-url重写
- 【DataSet】DataSet、DataTable、DataRow区别详解
- 【asp】asp.net 动态添加多个用户控件-net-动态添
- 【ASP】ASP.NET中内嵌页面代码的一个问题-NET-内
- 【As】Asp.net中的页面乱码的问题-sp--pn-ne-et
- 【增加记录】asp.net中获取新增加记录的ID Access
- 【创建】ASP.NET Web API教程 创建域模型的方法详
- 【Asp】Asp.net 页面调用javascript变量的值-net-
- 【ASP】ASP.NET 5升级后如何删除旧版本的DNX-NET5
- 【404页面】ASP.NET设置404页面返回302HTTP状态码
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
