View Single Post
  #2 (permalink)  
Old 02-27-2008, 08:58 AM
jrjespersen jrjespersen is offline
Member
 
Join Date: Nov 2007
Posts: 31
Default

Can you be more specific about your issue? Is the code throwing an exception?

Here's a basic sub that will create a user. It's by no means complete, but it at least should test the plumbing.

Code:
	Public Sub CreateUser()
		' Create the web service client
		Dim wsProxy As New UserManagementServiceProxy
		wsProxy.Url = "http://example.com/services/usermanagementservice.asmx"

		' Authenticate as an admin
		Dim nToken As Nullable(Of Guid)
		nToken = wsProxy.AuthenticateUser("admin", "admin")
		If nToken.HasValue Then
			Dim adminToken As Guid
			adminToken = nToken.Value

			'Create a user with no profile properties
			Dim UserID As String
			UserID = wsProxy.CreateUser(adminToken, "NewUserName", "NewPassword", Nothing, True)
		End If
	End Sub
Reply With Quote