0

我已使用以下代码片段通过以下代码片段从 WCF 服务获取数据。

 EmployeeServiceClient serviceClient=new EmployeeServiceClient();
            serviceClient.GetDataCompleted += new EventHandler<GetDataCompletedEventArgs>(serviceClient_GetDataCompleted);
            serviceClient.GetDataAsync(5);

但是关于如何解决这个问题,我得到了以下例外。

System.ArgumentException occurred
  Message=The provided URI scheme 'http' is invalid; expected 'https'.
Parameter name: via
  StackTrace:
       at System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via)
       at System.ServiceModel.Channels.HttpChannelFactory.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via)
       at System.ServiceModel.Channels.HttpChannelFactory.OnCreateChannel(EndpointAddress remoteAddress, Uri via)
       at System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via)
       at System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via)
       at System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via)
       at System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via)
       at System.ServiceModel.ClientBase`1.ChannelBase`1..ctor(ClientBase`1 client)
       at GridDataControlSilverlightWCFService.ServiceReference1.EmployeeServiceClient.EmployeeServiceClientChannel..ctor(ClientBase`1 client)
  InnerException:

我的确切要求将数据从服务加载到 Silverlight 主项目。你能帮助任何人吗?在此先感谢。

问候,

拉贾塞卡

4

0 回答 0