...answers when you need them
866-430-8274    1-617-715-9605
  • Free Version
  • Contact Us
  • Login

Checkbox Forums

Register | Help
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17
  1. #1
    jrjespersen Guest

    Exclamation Create user/Delete user/Create User issue

    We're using the User Management web service to create users on demand. I've encountered an issue in 4.4.1.14 with recreating users:
    1. Create a user with ID 123456. I've done this step both through the web UI and the web service.
    2. Delete the user. I'm doing this step through the web UI.
    3. Recreate the user ID 123456. When I do this step through the web service, the user data is updated in the ckbx_CustomUserFieldMap table, but the user is not re-added to the ckbx_Credential table.

    This process worked for us on version 4.4.0.5.

    Any thoughts on what to look for or why this isn't working?

    Thanks,
    Jonathan

  2. #2
    jrjespersen Guest

    Default

    In our custom app, the way we're detecting if a user already exists in the database is by calling GetUserProfile, and if it returns a profile then we don't call CreateUser - we call UpdateUserProfile. It looks like deleting the user doesn't delete profile data. Is this true?

  3. #3
    pwiesner is offline Administrator
    Join Date
    Mar 2007
    Posts
    382

    Default

    Thank you for bringing this to our attention. This appears to be a bug. I will look into the issue and respond when I have a better understanding of what is going on.

  4. #4
    richardt Guest

    Default

    Hi we are experiencing the same problem, and it is causing us a few headaches.

    Can you please keep me informed of any progress with this?

  5. #5
    pwiesner is offline Administrator
    Join Date
    Mar 2007
    Posts
    382

    Default

    I am still looking into the issue. I need to speak with another developer who is out today in order to get a better understanding of how things should behave.

    I would suggest using the GetUserIdentities method to determine if a user already exists. You will want to search on the UniqueIdentifier field and use the username as the search value.

    string[] userIdentities = wsProxy.GetUserIdentities(contextToken, "UniqueIdentifier", userName);

  6. #6
    jrjespersen Guest

    Default

    I completely overlooked that method when I was digging into this. I'll try it out and see if that corrects the behavior of our code.

  7. #7
    jrjespersen Guest

    Default Am I doing something wrong here?

    I have the method below in a class in a test application (to validate that we can change our custom app regarding this thread). I'm encountering a strange behavior: the first time I call my AuthenticateUser() method, I get a successful response. The second time I call it, I get an exception when calling UserManagementServiceProxy.AuthenticateUser(). This pattern then repeats itself indefinitely, alternating success and failure. It doesn't appear to matter how quick or far apart (< 30 secs) subsequent requests are made.

    The exception text is "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server."

    I found some references from a web search that identify overriding the GetWebRequest method and disabling turning off KeepAlives, and that method works if I create a class and inherit from UserManagementServiceProxy. My question is, should I have to do this, or am I doing something wrong in my client code?

    Note that my example is with AuthenticateUser - which I won't be calling that frequently - but this pattern exists for any web service methods I am calling.

    Thanks,
    Jonathan


    Code:
    UserManagementServiceProxy WebServiceProxy;
    Nullable<Guid> NullableGuid;
    Guid AdminGuid;
    
    private Boolean AuthenticateUser(String UserID, String Password, String WebServiceUrl)
    {
    	InitializeWebServiceProxy(WebServiceUrl);
    	NullableGuid = WebServiceProxy.AuthenticateUser(UserID, Password);
    	if (NullableGuid != null)
    	{
    		AdminGuid = NullableGuid.Value;
    		return true;
    	}
    	return false;
    }
    
    private void InitializeWebServiceProxy(String WebServiceUrl)
    {
    	if (WebServiceProxy == null)
    	{
    		WebServiceProxy = new UserManagementServiceProxy();
    	}
    	WebServiceProxy.Url = WebServiceUrl;
    }
    Last edited by jrjespersen; 02-22-2008 at 04:05 PM.

  8. #8
    ncushing is offline Administrator
    Join Date
    Mar 2007
    Location
    Prezza Technologies
    Posts
    207

    Default

    This error can appear if your connection to the web server passes through a proxy. If that is the case, you can configure your application for the proxy by adding the following to the <configuration /> section of your app.config.

    Code:
    <system.net>
            <defaultProxy>
                <proxy
                     usesystemdefault = "false"
                     proxyaddress="http://[PROXY_URL]:[PORT]"
                     bypassonlocal="true"
            />
            </defaultProxy>
        </system.net>

  9. #9
    jrjespersen Guest

    Default

    Thanks for the reply. That makes sense. However, in this case, I am not going through a proxy. For the test harness, I am going directly against the IP address of the web server - which is on the same network as my test harness.

    The odd thing is that in our custom app (which is a windows service), I haven't observed this behavior. It makes multiple subsequent web service calls without an exception. I'll step through the code more this weekend, but for now, I'm just trying to get my test app standing up and calling all the web service methods we use in the windows service.

    For now, I'll just keep using the inherited class with KeepAlives off. I was just wondering if the problem was something obvious.

    Thanks again!
    Last edited by jrjespersen; 02-22-2008 at 04:46 PM.

  10. #10
    ncushing is offline Administrator
    Join Date
    Mar 2007
    Location
    Prezza Technologies
    Posts
    207

    Default

    You may be going through a proxy even though you don't realize it depending on the configuration of your system, so you may want to give the setting a try anyway (though extending the proxy is certainly valid too).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Feedback

SEO by vBSEO 3.5.0