| Author |
Share Topic Topic Search Topic Options
|
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Topic: Web Service Authentication Posted: 18-Sep-2008 at 2:15pm |
I am attempting to add a Web Service for an application. When I try and get a DataSet ( mWebService.GetContactsDataSet(q, String.Empty);) it fails.
I have tried tracing the error but it does not create the error on my code it creates it after leaving Login in the LoginManager.
Soap Detail Error Message: "<Exception name=\"IdeaBlade.Persistence.PersistenceServerException\" message=\"Object reference not set to an instance of an object.\" operationType=\"Login\" failureType=\"Other\" />"
Stack Trace: " at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)\r\n at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)\r\n at LOC.CEMS.Webservice.Tests.CEMSWebservice.WebService.GetContactsDataSet(Query pQuery, String pDataSourceExtension) in C:\\Development\\CEMS\\NUnitTests\\LOC.CEMS.Webservice.Tests\\Web References\\CEMSWebservice\\Reference.cs:line 296\r\n at LOC.CEMS.Webservice.Tests._Default.Page_Load(Object sender, EventArgs e) in C:\\Development\\CEMS\\NUnitTests\\LOC.CEMS.Webservice.Tests\\Default.aspx.cs:line 39\r\n at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)\r\n at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n at System.Web.UI.Control.OnLoad(EventArgs e)\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"
Help would be greatly appreciated.
Environment:
Webservice is a project in the solution. Created test web site app, added to solution, to call the web service.
Code:
mWebService = new CEMSWebservice.WebService();
LoginCredential credential = new LoginCredential();
credential.Username = "admin";
credential.Password = CryptoFns.MD5HashUTF16ToString("password");
this.mWebService.Security = new SecurityHeader();
this.mWebService.Security.UsernameToken = credential;
Query q = new Query();
QueryClause clause = new QueryClause();
clause.ColumnName = "InActive";
clause.ColumnValue = "False";
q.Expressions = new QueryExpression[] { clause };
this.mResultsGrid.DataSource = mWebService.GetContactsDataSet(q, String.Empty);
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 19-Sep-2008 at 12:13pm |
If you haven't already, change your <logFile> value in the IdeaBlade.ibconfig to a hard-coded path so that you can easily find the debuglog.xml file generated by the service. Then, if you could post that, or send it to support that will give us a little more to go on.
Also, add some TraceFns.WriteLine statements to both your LoginManager implementation and the generated web service method (or create a new webmethod) so we can see what's going on when the problem occurs.
And finally, were you able to successfully run the WsPublishing tutorial?
|
 |
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Posted: 19-Sep-2008 at 12:26pm |
|
I was able to successfully run the WS app example. There are only 2 difference:
1. I am logging in using custom roles an users set by the app.
2. Using the Cabana framework
Logging in works fne for my app. I will post the results of the debuglog as soon as I can. It did not create the log I. The webservice by default I will check the ibconfig file for that setting
|
 |
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Posted: 19-Sep-2008 at 12:51pm |
The Web Service itself is not creating a LogFile I have checked the AppHelper LogFile but it is only from the last time the app was ran. I have checked the web app and the web service and have not found the log.
I can send you the project if you like. Where to?
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 19-Sep-2008 at 2:38pm |
OK. Zip it up and send to support@ideablade.com, attention Kim.
|
 |
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Posted: 22-Sep-2008 at 10:10am |
While trying to do some further testing I alter the LoginManager.Login to use the sample units code. Authenticate any user with username admin pswd admin. I then changed the credentials on the test web site. This test passed and loaded the query.
I went back to my custom authentication, by user in user table and roles assigned. It leaves the Login method successfully but fails after that. I know that the Login method is called by the PM. What exactly happens after that? What does the calling method need that could be null?
The error says something about Proxy - "IdeaBlade.Persistence.PersistenceServerException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at IdeaBlade.Persistence.RemotingPersistenceServerProxy.CheckConnection(Exception pException) at IdeaBlade.Persistence.PersistenceServerProxy.Login(ILoginCredential pCredential) at IdeaBlade.Persistence.PersistenceManager.DoLogin(ILoginCredential pCredential) at IdeaBlade.Persistence.PersistenceManager.Login(ILoginCredential pCredential) --- End of inner exception stack trace --- at IdeaBlade.Persistence.PersistenceManager.HandlePersistenceServerException(Exception pException, Boolean pTryToHandle, PersistenceOperation pOperation) at IdeaBlade.Persistence.PersistenceManager.Login(ILoginCredential pCredential) at ..."
Am I missing a proxy setting. I have verified that my ibconfig file matches the sample units ibconfig file.
|
 |
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Posted: 22-Sep-2008 at 10:12am |
And one other note:
The log file is never created.
|
 |
orcities
Senior Member
Joined: 28-Aug-2007
Location: United States
Posts: 454
|
Post Options
Quote Reply
Posted: 22-Sep-2008 at 10:18am |
Ok. I got it.
I assumed that since I did not set the domain it would be String.Empty. This is not the case. The credential.Domain can not be excluded. When I added String.Empty to the domain it passed.
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 22-Sep-2008 at 10:37am |
Thanks for the info on LoginCredential.Domain.
Your debug log is more than likely being written to somewhere deep below C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files. If you set the <logFile> in the ibconfig within AppHelper to a qualified path name (e.g., c:\temp\debuglog.xml), then you'll be able to easily find and use the log.
|
 |