Consume SOAP in Asp.net Core 2

0

I have a project in ASP.NET MVC CORE 2.

I have a SOAP that I use for User Login (User, Password) that I must return a 0 or a 1 in case the password corresponds to the user.

I am something new in ASP.NET CORE, could you support me to implement it?

using Microsoft.AspNetCore.Mvc;
using LoginServices;
using icmcore.Models;

namespace icmcore.Controllers
 {
     public class LoginController : Controller
{


    public IActionResult Index()
    {
        return View();
    }

    [HttpPost]
    public ActionResult Login(string rpe, string password)
    {

        var cliente = new wsLoginSoapClient();

        var dt = cliente.DirectorioPersonalAsync(rpe, password);
        var iCodigo = "";
        if (dt != null)
        {
            iCodigo = dt.Rows[0]["CodigoError"].ToString();
            if (iCodigo == "0")
            {
                return RedirectToAction("Home", "Index");
            }
            else
            {
                return RedirectToAction("Home", "About");
            }
        }


        return View();
    }

 }
}
    
asked by Enritux 06.04.2018 в 15:51
source

0 answers