Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsOther Extension...Other Extension...UserController.UserLogin exceptionUserController.UserLogin exception
Previous
 
Next
New Post
4/4/2011 11:06 PM
 
I am using DNN 6.5.1.

I want to leverage the DotNetNuke Entities controllers to retrieve data from the DNN database. If I use these classes in a DNN module everything works fine. However I want to use the Entities controllers in a WCF service. The code below illustrates how I am trying to login using my admin user.

C# Code

UserLoginStatus userLoginStatus = new UserLoginStatus();
UserController.UserLogin(0, "admin_user", "admin_password", string.Empty, string.Empty, "127.0.0.1",
                ref userLoginStatus, false);

Executing my service contract method with these two lines of code via the WCF Test Client always returns NullReferenceException.

I have also attempted this using a Windows Console Application with the same result.

I think it is related to the web.config file which I created using the standard DNN web.config with the system.serviceModel section added.

We are looking to purchase the Enterprise Edition and solving problems like this are critical to our decision making. I will be very grateful for any pointers on how to use the DNN Entity Controllers outside of a DNN module.

Mike...


 
New Post
4/5/2011 3:22 AM
 
on what line do you get the error exactly?

also: the way you log on is very insecure, as you give your webservice equal access as admins....

See for instance this blog for more information about WCF authentication and DotNetNuke: http://www.gooddogs.com/Blog/tabid/97...

Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
4/5/2011 11:13 AM
 
The error is from the UserController.UserLogin line. I have seen the post you referred to. The first two lines of the Login function I copied and converted to C#.

Once I get it working then I'll think about security implications.

Thanks for your help.
 
New Post
4/5/2011 11:16 AM
 
Here is the stack trace: -

at DotNetNuke.Entities.Users.UserController.ValidateUser(Int32 portalId, String Username, String Password, String authType, String VerificationCode, String PortalName, String IP, UserLoginStatus& loginStatus)
at DotNetNuke.Entities.Users.UserController.ValidateUser(Int32 portalId, String Username, String Password, String VerificationCode, String PortalName, String IP, UserLoginStatus& loginStatus)
at DotNetNuke.Entities.Users.UserController.UserLogin(Int32 portalId, String Username, String Password, String VerificationCode, String PortalName, String IP, UserLoginStatus& loginStatus, Boolean CreatePersistentCookie)
at DepartmentWcfService.DepartmentWcfService.GetUsers() in C:\Users\mwhy\Documents\My Web Sites\dotnetnuke\DesktopModules\Volunteers\DepartmentWcfService\DepartmentWcfService.svc.cs:line 26
at SyncInvokeGetUsers(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
 
New Post
4/5/2011 6:33 PM
 
hmm, to be honest, doesnt ring a bell. Could you install the DNN symbol files, so you will also get line numbers of the core code in your stack trace? You can find the symbol files on the codeplex download page of DNN. Its just an installable package for your current install. Just make sure you install the same version as your DNN version

Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsOther Extension...Other Extension...UserController.UserLogin exceptionUserController.UserLogin exception


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out