Integrate with DRM-X - Synchronize Users to DRM-X Platform ASP.net VB Guide (Call AddNewUser function)

Overview:

DRM-X XML Web service provides the interface you can integrate your system with DRM-X platform. 

Integration Method: 
1. Synchronize user integration    2. Custom login page integration

Note: Synchronize user integration is synchronize your website users to DRM-X.com your user. You use the default DRM-X login page. We protect the password with strong encryption. It's secure and easy. (Recommend for most users)

Custom login page integration is when user acquiring license, it will pop up your website DRM login window to acquire license. It requires you create a new DRM login page. It requires more code work. (Not Recommend, only for advanced users)

Here we introduce synchronize user integration:

DRM-X XML Web service provides the interface you can use synchronize your users to DRM-X platform.  

It is very simple just call AddNewUser or UpdateUser function, and provide several parameter.

The AddNewUser function needs the following parameters:

You can visit the standard DRM-X Web service from here: http://www.drm-x.com/haihaisoftLicenseservice.asmx?op=AddNewUser

The following parameter,blue text is required field. For not require black field, you can set "N/A" (means empty) or with the correct value.


AdminEmail. AdminEmail is your login Email of DRM-X Account.
WebServiceAuthStr. WebServiceAuthStr is the Web Service Authenticate String for DRM-X web service. You can set this value in Profile - Website Integration Preferences of your DRM-X Account.
GroupID. GroupID is the ID of your Group that you created in your DRM-X account. You can find GroupID value in Users Group of DRM-X Account.
UserLoginName. UserLoginName is the username or unique UserID in your user database.
UserPassword. UserPassword is the Password of user in your user database.
UserEmail. UserEmail is the Email of user in your user database.
UserFullName. UserFullName is the Full Name of User. This parameter is option. You can leave this UserFullName parameter to blank, or just set it value to N/A.
Title
Company
Address
City
Province
ZipCode
Phone
CompanyURL
SecurityQuestion
SecurityAnswer
SecurityQuestion
IP.  IP is the IP address of your user which acquire license. You can provide this Parameter.
Money Money is the money amount of user at DRM-X.com. By default, you can set this value to 0, and manually set the value at DRM-X.com
BindNumber. You can control the license can be used in how many computers by setting BindNumber.
IsApproved Set whether user is approved. Please set "yes" if you approve user to login, otherwise set "no". The default value should be "yes"
IsLockedOut Set whether user is locked out. Please set "yes" if you lock out user, otherwise set "no". The default value should be "no"

After you call AddNewUser function, it will return 1 (means add new user successfully) or return error message to you.

STEP BY STEP INSTRUCTIONS

Step 1: The web service URL is :
http://www.drm-x.com/haihaisoftlicenseservice.asmx 

In Visual Studio.net 2003 or Visual Studio.net 2005, please Add Web References in Solution Explorer. The web service URL is :
http://www.drm-x.com/haihaisoftlicenseservice.asmx
You can set the Web Reference Name to drm_x.


Step 2: Then you can add code to your member sign up page.

Here is the sample code added to register button:


   Private Sub txtregister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtregister.Click
        'XML web service Integration Settings, set No.
        'When modify user information, username can not be updated, if you need user update username, you have to add a new user.
        'GroupID. If you have multiple Groups, you have to list Group, and let customer choose one user group to register.
        Dim DRM As New drm_x.HaihaisoftLicenseService

        Dim AdminEmail As String = "your@login_mail.com"  'AdminEmail is your login Email of DRM-X Account.
        Dim WebServiceAuthStr As String = "123" ''WebServiceAuthStr is the Web Service Authenticate String for DRM-X web service. You can set this value in Profile - Website Integration Preferences of your DRM-X Account.

        Dim UserLoginName As String = Me.txtusername.Text   'UserLoginName is the username or unique UserID in your user database.
        Dim UserPassword As String = Me.txtpassword.Text
        Dim UserEmail As String = "user@email.com"
        Dim UserFullName As String = "test3" ' UserFullName is the Full Name of User. This parameter is option. You can leave this UserFullName parameter to blank, or just set it value to N/A.
        Dim GroupID As String = 90129 ' GroupID GroupID is the ID of your Group that you created in your DRM-X Accounts. Your can find GroupID value in Users Group of DRM-X Accounts.
        Dim Message As String '  Message is the license information, like license rights information returned from DRM-X web service.
        Dim IP As String = "192.168.1.103"
        Dim Money As String = "0"
        Dim BindNumber As String = "2"

        Dim result As String

        result = DRM.AddNewUser(AdminEmail, WebServiceAuthStr, GroupID, UserLoginName, UserPassword, "sunny53@haihaisoft.com", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", Money, BindNumber, "yes", "no")

        Response.Write(result)

    End Sub
       
Step 3: Run your member sign up page.  Make sure you set the WebServiceAuthStr Web Service Authenticate String at Profile - Website Integration Preferences of your DRM-X account. If it returns Message to 1, it means synchronize user successfully. If it fails, please check the returned message and all the parameters, and try again.

Step 4: UpdateUser. Like call AddNewUser function in your sign up page, you can also call UpdateUser when user updates his or her profile in your website.

Call UpdateUser function is very similar with call AddNewUser. You can read the XML web service document from here, and use the AddNewUser code in the above code.

http://www.drm-x.com/haihaisoftLicenseservice.asmx?op=UpdateUser

Step 5: Add your existed users to DRM-X.com. To add your existed users to DRM-X.com. You need to create a loop program, read users information from your database, and then call AddNewUser to synchronize users to DRM-X.com. You need to transfer non-encrypted password to DRM-X.com. DRM-X.com encrypts the password with strong MD5 encryption.

Call UpdateUser function is very similar with call AddNewUser. You can read the XML web service document from here, and use the AddNewUser code in the above code.

Attachment:
Sample ASP.net Visual Basic Code. Please download it from here: http://www.drm-x.com/download/DRM-X-integration_ASP.net_Code.zip

To integrate with Joomla 1.5.x, you don't need to write code. Haihaisoft provides the Haihaisoft DRM-X Plugin For Joomla.  You can download it from here: http://www.drm-x.com/DRM_Joomla_Plugin.aspx

If you have any questions about this article, please feel free to contact us.


Was this information helpful?


You may also be interested in...
Integrate with DRM-X - Custom Login Page Integration ASP.net VB Guide (Call getLicenseRemote function)
Disable User Account Control (UAC) the Easy Way on Windows Vista or Windows 7
Step 5: Protect Audio/Video Files
Integrate with DRM-X - Synchronize Users to DRM-X Platform PHP Guide (Call AddNewUser function)
Step 4: Create Rights and License Profile


For more help, or submit your questions. Please visit Haihaisoft Community