我使用以下代码段通过使用以下代码段从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主项目。 你能帮忙解决一下吗。提前谢谢你。
此致
Rajasekar