Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

How to debug a function/method from another project in .asmx web service

$
0
0

I want to debug a function from another project in .asmx web service.

Here I will explain my code,

using System.Web;
using System.Web.Services;
using System.Xml;
using InternalDataLayer;

using System.Data;
using System.IO;

[WebMethod]
public XmlDocument VerifyUser(string strADID, string strEncPassword, Int64 intRoleId)
{
Logs log = new Logs();
try
{
XmlDocument XmlDoc = new XmlDocument();

bool IsLdapAuthenticated = false;
if (ConfigurationManager.AppSettings["IsLdapAuthenticated"].ToString().CompareTo("True") == 0)
{
IsLdapAuthenticated = true;
}

string strDomainName = ConfigurationManager.AppSettings["DomainName"].ToString();

AuditUser CurrentUser = new AuditUser();
DataTable dtResult = CurrentUser.VerifyLogin(strADID, strEncPassword, intRoleId, IsLdapAuthenticated, strDomainName);
dtResult.TableName = "LoginResult";
DataSet dsResult = new DataSet();
dsResult.DataSetName = "VerifyLogin";
dsResult.Tables.Add(dtResult);
XmlDoc.LoadXml(dsResult.GetXml());


return XmlDoc;
}
catch (Exception ex)
{

log.AddLogs(Logs.LogTypeCodes.Error.ToString(), "VerifyLogin", ex.GetType().Name, ex.Message, 1);
throw;
}

---------------------------------------------------------------

As I have made it bold, InternalDataLayer is another project. AuditUser is class in that project and VerifyLogin() is method in that class where actual verification and all sql statements are written.

When I try to debug webmethod VerifyUser() method how to debug inside method,

CurrentUser.VerifyLogin(strADID, strEncPassword, intRoleId, IsLdapAuthenticated, strDomainName);

Now even if I put break point at 1st statement in VerifyUser() (Logs log = new Logs();), it does not go into CurrentUser.VerifyLogin() method. just goes directly to next statement, dtResult.TableName = "LoginResult"; So not sure what is happening in CurrentUser.VerifyLogin() method.

Normally I set .asmx page as startup page and run the project in debug mode and then put break point in particular web method.


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>