i have define web service in class library project (dll) using c#.net
My code:
var remoteAddress = new System.ServiceModel.EndpointAddress("https://technet.rapaport.com/webservices/prices/rapaportprices.asmx");
System.ServiceModel.BasicHttpBinding bd = new System.ServiceModel.BasicHttpBinding();
bd.MaxBufferPoolSize = Int32.MaxValue;
bd.MaxBufferSize = Int32.MaxValue;
bd.MaxReceivedMessageSize = Int32.MaxValue;
bd.ReaderQuotas.MaxStringContentLength = Int32.MaxValue;
objRapNetService = new DxlExcelAddIns.RapaportPrices.RapaportPricesSoapClient(bd, remoteAddress);
objRapNetService.Endpoint.Binding.SendTimeout = new TimeSpan(0, 1, 10, 0);
objTicket = objRapNetService.Login(UserName, Password); // show error from here...
//objRapNetService = new DxlExcelAddIns.RapaportPrices.RapaportPricesSoapClient();
string oldAddress = objRapNetService.Endpoint.Address.ToString();
string newAddress = "http" + objRapNetService.Endpoint.Address.ToString().Substring(5);
System.ServiceModel.EndpointAddress address = new System.ServiceModel.EndpointAddress(newAddress);
objRapNetService.Endpoint.Address = address;
objRapNetService.InnerChannel.OperationTimeout = System.TimeSpan.MaxValue;
Error:--------------------
{System.ArgumentException: The provided URI scheme 'https' is invalid; expected 'http'.
Parameter name: via
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.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via)
at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)
at System.ServiceModel.ChannelFactory`1.CreateChannel()
at System.ServiceModel.ClientBase`1.CreateChannel()
at System.ServiceModel.ClientBase`1.CreateChannelInternal()
at System.ServiceModel.ClientBase`1.get_Channel()
at DxlExcelAddIns.RapaportPrices.RapaportPricesSoapClient.DxlExcelAddIns.RapaportPrices.RapaportPricesSoap.Login(LoginRequest request) in D:\mehul\DxlExcelAddIns\Service References\RapaportPrices\Reference.cs:line 575
at DxlExcelAddIns.RapaportPrices.RapaportPricesSoapClient.Login(String Username, String Password) in D:\mehul\DxlExcelAddIns\Service References\RapaportPrices\Reference.cs:line 582
at DxlExcelAddIns.AppLib.Service.StartRapaportService(String UserName, String Password) in D:\mehul\DxlExcelAddIns\Applib\Service.cs:line 38
at DxlExcelAddIns.AppLib.Methods.ImportPriceListFromRapaPort(Int32 SingleRow, String SheetName) in D:\mehul\DxlExcelAddIns\Applib\Methods.cs:line 728}