D
djmc
Hi,
In my web application, I catch SoapExceptions and check the
SoapException.Message property to determine the error that occurred. For
instance, when authenticating a user, if the incorrect password is detected,
the following message is contained within SoapException.Message:
Password is incorrect for user
However, when I publish my web application to the production server (Using
Build/Publish Web Site in Visual Studio 2005 Pro RTM), SoapException.Message
returns:
System.Web.Services.Protocols.SoapException: Password is incorrect for user.
at SecureServices.AuthenticateUser(String username, String password)
This only happens when I publish the website. It does not occur when
testing locally. Could this be an inconsistency between IIS and Cassini?
Why would this happen? Also, if I am incorrectly passing errors back to my
web services client, please advise me on the correct way to do so. Here is
the code below that provides the above errors.
Web Service called:
[WebMethod]
public string AuthenticateUser(string username, string password)
{
string sAuthToken;
ErrorResponse response;
sAuthToken = UserLogic.AuthenticateUser(username, password, out response);
if (response.ResponseID != ErrorResponseIDs.Success)
throw new SoapException(response.ResponseMessage,
SoapException.ClientFaultCode);
return sAuthToken;
}
Web Service client that catches errors:
public static string AuthenticateUser(string username, string password, out
string errormessage)
{
string sAuthToken = "";
errormessage = null;
try
{
sAuthToken = ServicesGateway.SecureServices.AuthenticateUser(username,
password);
}
catch (SoapException se) { errormessage = se.Message; }
return sAuthToken;
}
Web Application that displays error (shortened):
protected void lbLogin_Click(object sender, EventArgs e)
{
string sErrorMessage, sAuthToken;
sAuthToken = AuthenticationLogic.AuthenticateUser(tbUsername.Text,
tbPassword.Text, out sErrorMessage);
if (sErrorMessage != null)
lMessage.Text = sErrorMessage; // Display error to Label control lMessage
}
Again, I am using Visual Studio 2005 Pro RTM. I have tried publishing using
pretty much every combination of options (Allow this precompiled site., Use
fixed naming. etc) both checked and unchecked. I will try to compile the
site using Beta 2 and see if this was an issue for me before and I just had
never noticed.
Anyways, hope someone can shed some light on what's going on here.
Thanks!
-DJ
In my web application, I catch SoapExceptions and check the
SoapException.Message property to determine the error that occurred. For
instance, when authenticating a user, if the incorrect password is detected,
the following message is contained within SoapException.Message:
Password is incorrect for user
However, when I publish my web application to the production server (Using
Build/Publish Web Site in Visual Studio 2005 Pro RTM), SoapException.Message
returns:
System.Web.Services.Protocols.SoapException: Password is incorrect for user.
at SecureServices.AuthenticateUser(String username, String password)
This only happens when I publish the website. It does not occur when
testing locally. Could this be an inconsistency between IIS and Cassini?
Why would this happen? Also, if I am incorrectly passing errors back to my
web services client, please advise me on the correct way to do so. Here is
the code below that provides the above errors.
Web Service called:
[WebMethod]
public string AuthenticateUser(string username, string password)
{
string sAuthToken;
ErrorResponse response;
sAuthToken = UserLogic.AuthenticateUser(username, password, out response);
if (response.ResponseID != ErrorResponseIDs.Success)
throw new SoapException(response.ResponseMessage,
SoapException.ClientFaultCode);
return sAuthToken;
}
Web Service client that catches errors:
public static string AuthenticateUser(string username, string password, out
string errormessage)
{
string sAuthToken = "";
errormessage = null;
try
{
sAuthToken = ServicesGateway.SecureServices.AuthenticateUser(username,
password);
}
catch (SoapException se) { errormessage = se.Message; }
return sAuthToken;
}
Web Application that displays error (shortened):
protected void lbLogin_Click(object sender, EventArgs e)
{
string sErrorMessage, sAuthToken;
sAuthToken = AuthenticationLogic.AuthenticateUser(tbUsername.Text,
tbPassword.Text, out sErrorMessage);
if (sErrorMessage != null)
lMessage.Text = sErrorMessage; // Display error to Label control lMessage
}
Again, I am using Visual Studio 2005 Pro RTM. I have tried publishing using
pretty much every combination of options (Allow this precompiled site., Use
fixed naming. etc) both checked and unchecked. I will try to compile the
site using Beta 2 and see if this was an issue for me before and I just had
never noticed.
Anyways, hope someone can shed some light on what's going on here.
Thanks!
-DJ