Silverlight+WCF发布记录

今天折腾了一天,就弄好了一个问题,发布Silverlight程序到服务器,终于搞定了,写下记录一下

分两种情况

1 WCF与Silverlight在同一目录下

关键代码:

 

1  BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
2                 binding.MaxReceivedMessageSize = int.MaxValue;
3                 binding.MaxBufferSize = int.MaxValue;
4                 Service1Client ac = new Service1Client(binding, new EndpointAddress(
5                     new Uri(Application.Current.Host.Source, "../Service1.svc")));
6                 ac.QueryLiuShiGongShiReportAsync(sb.ToString());
7                 ac.QueryLiuShiGongShiReportCompleted +=
8                     new EventHandler<QueryLiuShiGongShiReportCompletedEventArgs>(ac_QueryLiuShiGongShiReportCompleted);
9                 ac.CloseAsync();

 2 WCF与silverlight不在同一目录下

http://www.aspxcs.net/HTML/2345222075.html

非常的详细说明了。

 

 

posted @ 2011-07-25 20:23  科睿思博  阅读(252)  评论(0编辑  收藏  举报