c# - How to update client endpoint binding in code -


i have question modifying client endpoint binding in code. have added web service reference , created client endpoint binding it. in web.config binding set basic https, want change ex. http, have specified in web.config under name "basichttpbinding". when create instance of web service reference, there no way of using address , binding there not constructor takes such arguments.

  <endpoint address="http://localhost/localservice/sendrequest.asmx"     binding="basichttpsbinding" bindingconfiguration="basichttpsbinding"     contract="localservice.sendrequest" name="localserviceclient" /> 

any advice how solve problem appreciated.

cheers!

var binding = new system.servicemodel.basichttpbinding() { name = "localserviceclient", namespace = "localservice.sendrequest" }; var endpoint = new system.servicemodel.endpointaddress("http://localhost/localservice/sendrequest.asmx"); var client = new serviceclient(binding, endpoint); 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -