Go Back   CHECKBOX® Online Community > Checkbox® > CHECKBOX® Survey Server 4.x

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-21-2008, 12:33 PM
jrjespersen jrjespersen is offline
Member
 
Join Date: Nov 2007
Posts: 31
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
Reply With Quote
  #2 (permalink)  
Old 02-21-2008, 01:08 PM
jrjespersen jrjespersen is offline
Member
 
Join Date: Nov 2007
Posts: 31
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?
Reply With Quote
  #3 (permalink)  
Old 02-21-2008, 01:51 PM
pwiesner pwiesner is offline
Senior Member
 
Join Date: Mar 2007
Posts: 167
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.
Reply With Quote
  #4 (permalink)  
Old 02-22-2008, 04:12 AM
richardt richardt is offline
Junior Member
 
Join Date: Feb 2008
Posts: 8
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?
Reply With Quote
  #5 (permalink)  
Old 02-22-2008, 11:01 AM
pwiesner pwiesner is offline
Senior Member
 
Join Date: Mar 2007
Posts: 167
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);
Reply With Quote
  #6 (permalink)  
Old 02-22-2008, 11:09 AM
jrjespersen jrjespersen is offline
Member
 
Join Date: Nov 2007
Posts: 31
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.
Reply With Quote
  #7 (permalink)  
Old 02-22-2008, 04:02 PM
jrjespersen jrjespersen is offline
Member
 
Join Date: Nov 2007
Posts: 31
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.
Reply With Quote
  #8 (permalink)  
Old 02-22-2008, 04:30 PM
ncushing ncushing is offline
Administrator
 
Join Date: Mar 2007
Location: Prezza Technologies
Posts: 173
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>
Reply With Quote
  #9 (permalink)  
Old 02-22-2008, 04:43 PM
jrjespersen jrjespersen is offline
Member
 
Join Date: Nov 2007
Posts: 31
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.
Reply With Quote
  #10 (permalink)  
Old 02-22-2008, 05:03 PM
ncushing ncushing is offline
Administrator
 
Join Date: Mar 2007
Location: Prezza Technologies
Posts: 173
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).
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:23 AM.


Search Engine Friendly URLs by vBSEO 3.0.0 RC8