Hi,
I used webservice in asp.net boiler plate application(Login verification purpose). That webservice check the tenant name,user and password if success and return login based on tenantId. This webservice i called one application that time i am getting this error "SoapException was unhandled". Please check my Code and give some tips (or) example [WebMethod] public async Task<int> GetTenantId(string strTenancy, string strUser, string strPwd) { int tentId = await GetLoginResult(strTenancy, strUser, strPwd); return tentId; }
private async Task<int> GetLoginResult(string strTenancy, string strUser, string strPassword)
{
string strRetVal = "";
int TId = 0;
try
{
var loginResult = await _logInManager.LoginAsync(strUser, strPassword, strTenancy);
switch (loginResult.Result)
{
case AbpLoginResultType.Success:
return loginResult.Tenant.Id;
default:
return TId;
}
}
catch (Exception ex)
{
throw ex;
}
}
}
[b]Here I am calling webservice[/b] LoginSample.LoginSample obj = new LoginSample.LoginSample(); var n = obj.GetTenantId(strTen, strUser, strPwd);
Please give some suggestions. Thanks
3 Answer(s)
-
0
you need to modify your config file:
<system.net> <settings> <httpWebRequest useUnsafeHeaderParsing="true" /> </settings> </system.net>Check out the issue on this link <a class="postlink" href="https://social.msdn.microsoft.com/Forums/en-US/2e3be101-b9c1-4b0d-a631-b840af1cdfc3/protocol-violation-can-i-change-how-sensible-the-test-shall-be-to-protocol-errors?forum=vststest">https://social.msdn.microsoft.com/Forum ... m=vststest</a>
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Not working still i am getting same error. Please check the webservice method I thing that this the problem. Please check
public class LoginSample : System.Web.Services.WebService { private readonly LogInManager _logInManager;
public LoginSample( LogInManager logInManager) { _logInManager = logInManager; } [WebMethod] public async Task<int> GetTenantId(string strTenancy, string strUser, string strPwd) { int tentId = await GetLoginResult(strTenancy, strUser, strPwd); return tentId; } private async Task<int> GetLoginResult(string strTenancy, string strUser, string strPassword) { string strRetVal = ""; int TId = 0; try { var loginResult = await _logInManager.LoginAsync(strUser, strPassword, strTenancy); switch (loginResult.Result) { case AbpLoginResultType.Success: return loginResult.Tenant.Id; default: return TId; } } catch (Exception ex) { throw ex; } } }Please check the code.
Thanks
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @kunnummal,
Do you have any detailed error message about this problem. Becasue it is hard to find reason of problem without an error message.
I suggest you to first catch error message. If the error occurs in AspNet Zero side, you can check Logs.txt file or you can check windows event viewer.
Thanks.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)