How can I add a Service Reference (WCF) without use the Solution Explorer and "Add Service Reference".
Hi everyone, I've added a Service Reference using the Solution Explorer and it works perfectly but now I need to add the Service Reference by code in C# I don't want to use the App.config file, all to do by code. I looked for in many sites but all use the Solution Explorer.
Please, give me some help with this.
This is my code.
BasicHttpBinding _enlace = new BasicHttpBinding();
_enlace.Security.Mode = BasicHttpSecurityMode.None;
EndpointAddress _direccion = new EndpointAddress("http://192.168.1.42/ServicioManejoArchivos.svc/ServicioManejoArchivos");
ServicioManejoArchivosClient _servicio = new ServicioManejoArchivosClient(_enlace, _direccion);
Documento _archivoEnviar = new Documento();
byte[] _cadenaBytes = File.ReadAllBytes(m_direccionArchivoTemporal);
_archivoEnviar.Archivo = _cadenaBytes;
_archivoEnviar.CodigoEmpresa = m_global.CodigoEmpresa;
_archivoEnviar.CodigoFacilidad = m_global.CodigoFacilidad;
_archivoEnviar.CodigoTercero = m_codigoTercero;
_archivoEnviar.Extension = ".zip";
_archivoEnviar.NombreArchivo = System.IO.Path.GetFileNameWithoutExtension(m_direccionArchivoTemporal);
_archivoEnviar.TipoDocumento = cmbTipoDocumento.Text;
_archivoEnviar.ModuloAfectado = m_global.CodigoArea;
_archivoEnviar.ProcesoEfectuado = base.m_tipoActividad.ToString();
var resultado = _servicio.GuardarArchivo(_archivoEnviar);
_servicio.Close();