添加对silverlight应用程序的wcf服务的引用

时间:2012-11-29 09:32:06

标签: c# asp.net wcf silverlight-4.0

我的代码如下:

                ServiceReference1.ImageFile imagefile = new ServiceReference3.ImageFile();
            imagefile.ImageName = fileName;
            imagefile.Imagestream = bytes;

            ServiceReference3.Service1Client service = new ServiceReference3.Service1Client();
            service.UploadCompleted += new EventHandler<ServiceReference3.UploadCompletedEventArgs>(service_UploadCompleted);
            service.UploadAsync(imagefile);

这里没有创建ServiceReference1如何在xaml.cs页面中创建服务引用并使ServiceReference1可用。任何人都对我有很大的帮助

1 个答案:

答案 0 :(得分:1)

MSDN教程:How to: Access a Service from Silverlight用于添加服务引用或用于Web引用

您可以这样做查看详细信息:Add Web Reference to Silverlight Application

enter image description here