I am missing something somewhere!

I am missing something somewhere!

Old forum URL: forums.lhotka.net/forums/t/6211.aspx


CyclingFoodmanPA posted on Tuesday, January 20, 2009

I have been going through the Rolodex example with a fine tooth comb and I am trying to figure out where the code DataPortal_Fetch is called in RolodexIdentity when in Silverlight mode?  I have stepped through GetCslaIdentity<RolodexIdentity>(completed, new CredentialsCriteria(username, password)); and gone through the Csla framework and still have not found where the sproc GetUser or Login is called.

Reason I am battling with this is my Silverlight prototype application continuously comes up with "Invalid login. Try again." and I have gone through the Web.config in the WcfHostWeb file and am sure I have the correct connection string.  I have turned on debugging in the Web.config file of the WcfHostWeb file and things seem to be ok, but I am still a little fuzzy with the Wcf stuff but am getting there.  But there are no glaring errors like not able to connect to the database or invalid connection string.

I am sure when I figure this out or someone steers me in the right direction, it will be a major "ahh duh" moment and I am anxiously awaiting that ahh duh monent because for the life of me, I cannot figure out how or where the Rolodex example is calling the sproc to validate the username and password.

Thanks for your help.

Keith

 

 

sergeyb replied on Tuesday, January 20, 2009

It is in DataPortal_Fetch in ROlodexIdentity.

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: CyclingFoodmanPA [mailto:cslanet@lhotka.net]
Sent: Tuesday, January 20, 2009 3:37 PM
To: Sergey Barskiy
Subject: [CSLA .NET] I am missing something somewhere!

 

I have been going through the Rolodex example with a fine tooth comb and I am trying to figure out where the code DataPortal_Fetch is called in RolodexIdentity when in Silverlight mode?  I have stepped through GetCslaIdentity<RolodexIdentity>(completed, new CredentialsCriteria(username, password)); and gone through the Csla framework and still have not found where the sproc GetUser or Login is called.

Reason I am battling with this is my Silverlight prototype application continuously comes up with "Invalid login. Try again." and I have gone through the Web.config in the WcfHostWeb file and am sure I have the correct connection string.  I have turned on debugging in the Web.config file of the WcfHostWeb file and things seem to be ok, but I am still a little fuzzy with the Wcf stuff but am getting there.  But there are no glaring errors like not able to connect to the database or invalid connection string.

I am sure when I figure this out or someone steers me in the right direction, it will be a major "ahh duh" moment and I am anxiously awaiting that ahh duh monent because for the life of me, I cannot figure out how or where the Rolodex example is calling the sproc to validate the username and password.

Thanks for your help.

Keith

 

 



CyclingFoodmanPA replied on Tuesday, January 20, 2009

Hi Sergey,

Yes, I see it there and I set breakpoints there, but it never stops at the breakpoint.  And also, it is after the #else for the #if SILVERLIGHT so it is not available for the Silverlight part of the code.  Do breakpoints not work in the code when you are executing apps in Silverlight?

Thanks,

Keith

 

solheim replied on Wednesday, January 21, 2009

Hi Keith,

You need to attach to the server process in order to debug the data-access code.

For Rolodex:

1. Open RolodexIdentity.cs from the Rolodex.Business.Server project.

2. Add breakpoint on DataPortal_Fetch

3. Start Debugging

4. In Visual Studio menu choose "Debug / Attach to process"

5. Choose process "ASP.NET Development Server - Port 2430" and click "Attach"
   (The WcfHostWeb Project is configured to run on port 2430)

6. Try Login in the silverlight client, you should hit the breakpoint on DataPortal_Fetch.


The same goes for debugging all manner of serverside Dataportal code.


Paul

sergeyb replied on Wednesday, January 21, 2009

An alternative, which is something I mentioned before, is to combine two web sites (WCF host and SL app host) into a single web application.  At that point both client and server will run in a single process, thus enabling you to debug client and server code from the same instance of VS.  Rolodex was setup the way it was to demonstrate how to split them up (which will be an advantage in production environment) and demonstrate the usage of cross-domain configuration files, but it does negatively affect development. 

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: solheim [mailto:cslanet@lhotka.net]
Sent: Wednesday, January 21, 2009 8:15 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: I am missing something somewhere!

 

Hi Keith,

You need to attach to the server process in order to debug the data-access code.

For Rolodex:

1. Open RolodexIdentity.cs from the Rolodex.Business.Server project.

2. Add breakpoint on DataPortal_Fetch

3. Start Debugging

4. In Visual Studio menu choose "Debug / Attach to process"

5. Choose process "ASP.NET Development Server - Port 2430" and click "Attach"
   (The WcfHostWeb Project is configured to run on port 2430)

6. Try Login in the silverlight client, you should hit the breakpoint on DataPortal_Fetch.


The same goes for debugging all manner of serverside Dataportal code.


Paul



CyclingFoodmanPA replied on Wednesday, January 21, 2009

Ok Sergey that makes more sense now.  I guess it is important to know both aspects of development - merging both projects Wcf and Silverlight into one app and splitting both of them.  I guess the bottom line is you have to do what is best for a production environment.  You cannot develop an application in one format, then switch it for production!  Well, you could, but you might not be employed for long!

Thank you both Paul and Sergey.  I have been beating my head against the wall for a week to figure out how to debug the DataPortal_Fetch and it was really, really bugging me.  You gus are great!

Take care,

Keith

sergeyb replied on Wednesday, January 21, 2009

IMHO, it is totally acceptable in this case to have two setups – one for production, one for development.  Essentially, by merging all you have to do is copy your .svc file over and merge WCF portion of web.config over.  Since there is really no code that you write for the web site, there is close to no risk in switching your setup for production and QA as well. Moreover, you do have to split the web sites for production eatiher, although it is probably a good idea.  All depends on amount of traffic and scaling out infrastructure.  If you are scaling web servers separately from application server, you have to split the web sites.

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: CyclingFoodmanPA [mailto:cslanet@lhotka.net]
Sent: Wednesday, January 21, 2009 8:31 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: RE: I am missing something somewhere!

 

Ok Sergey that makes more sense now.  I guess it is important to know both aspects of development - merging both projects Wcf and Silverlight into one app and splitting both of them.  I guess the bottom line is you have to do what is best for a production environment.  You cannot develop an application in one format, then switch it for production!  Well, you could, but you might not be employed for long!

Thank you both Paul and Sergey.  I have been beating my head against the wall for a week to figure out how to debug the DataPortal_Fetch and it was really, really bugging me.  You gus are great!

Take care,

Keith



CyclingFoodmanPA replied on Wednesday, January 21, 2009

Paul,

Thank you, thank you, thank you.  That was it.  I have been banging my head against the wall for the last few days trying to figure this out.  You are the man!

Keith

Copyright (c) Marimer LLC