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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPICannot Create User with DNN 7 WebAPICannot Create User with DNN 7 WebAPI
Previous
 
Next
New Post
6/8/2013 3:35 PM
 
Has anyone been able to create a user with the DNN 7 WepAPIFramework? I'm getting an "There was an error generating the XML document" exception in my call to UserController.CreateUser(ref user);

My helper function to create the user is a subclass of DnnApiController and I do have other .DnnApiController methods working correctly.

Here's my CreateUser function that is failing.

private void CreateUser()
{
UserInfo.Membership.Approved = true;
var user = UserInfo;
CreateStatus = UserController.CreateUser(ref user);
return;

if (CreateStatus == UserCreateStatus.Success)
{

////Assocate alternate Login with User and proceed with Login
//if (!String.IsNullOrEmpty(AuthenticationType))
//{
// AuthenticationController.AddUserAuthentication(UserInfo.UserID, AuthenticationType, UserToken);
//}


// _AccountRequest.Message = UserController.CompleteUserCreation(CreateStatus, user, true, IsRegister);
// create psari subscriber
SubscriberFactory sf = new SubscriberFactory();
Subscriber s = sf.CreateSubscriber();
s.SubcriberLevel = (int)SubscriberFactory.SubscriberLevel.Guest;
s.CityId = 0;
s.Email = _AccountRequest.Email;
// save subscriber to get subscriber id
s.Save();
_AccountRequest.SubscriberId = s.SubscriberId;
_AccountRequest.StatusCode = 0;
}
else
{
_AccountRequest.Message = UserController.GetUserCreateStatus(CreateStatus);
}
}

I've been able to trace the error to a call to this function in the DNN kernel:

private void AddDNNUserRole(UserRoleInfo userRole)

in the

public class DNNRoleProvider : RoleProvider

It seems that the code is excepting out one of the following class level variable instnatiation, since I never enter the AddDNNUserRole function.

private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (DNNRoleProvider));

private readonly DataProvider dataProvider = DataProvider.Instance();

Any suggestions would be greatly appreciated.




 
New Post
6/10/2013 6:45 AM
 
I finally found the issue, I was not setting the portal ID for my new users.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPICannot Create User with DNN 7 WebAPICannot Create User with DNN 7 WebAPI


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.

Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out