Rest web service calling soap web service(asmx), how? RRS feed

  • Question

  • I have this below code


        public class OptOutClientController : Controller
            HttpClient client = new HttpClient();
            private readonly IOptOutService _service;
            public OptOutClientController(IOptOutService service)
                _service = service;

            public OptOutCliente Unsubscribe([FromBody]OptOutCliente cliente)
                if (cliente == null)
                    throw new OptOutException("Informar os dados do cliente OptOut!");

                var valida = _service.Process(cliente);

                BasicHttpBinding httpBinding = new BasicHttpBinding();
                EndpointAddress wsUrl = new EndpointAddress("http://localhost:64460/OptOutService.svc");

                //ServicoWSClient soapClient = new ServicoWSClient(httpBinding, wsUrl);

                return cliente;


    How can I call a asmx web service? Into my var(parameter) **cliente** i have an object. I need to send this object to **asmx web service**. How can i do this?

    Monday, June 25, 2018 4:37 PM