We can use the following sample code to create the binding in code behind.
BasicHttpBinding myBinding = new BasicHttpBinding(); myBinding.Name = "ARV.MyService"; myBinding.Security.Mode = BasicHttpSecurityMode.None; myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None; myBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None; myBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName; EndpointAddress endPointAddress = new EndpointAddress("http://eea5f8cbdbc749b0bcea2b6250cbae11.cloudapp.net/Myservice.svc"); MyServiceClient client = new MyServiceClient(myBinding, endPointAddress); client.sendSMS();