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
Step 2: Then you can add code to your member sign up page.
Here is the sample code:
<?php
require_once('nusoap.php');
$wsdl="http://www.drm-x.com/haihaisoftlicenseservice.asmx?wsdl";
$client=new soapclient2($wsdl, 'wsdl');
//Before you using the following code, please make sure you set the variable value for:
// $AdminEmail, $WebServiceAuthStr, $GroupID, $user['username'], $user['password'], $user['email'], $user['name'], $Money, $BindNumber
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = false;
$param = array(
'AdminEmail' => $AdminEmail,
'WebServiceAuthStr' => $WebServiceAuthStr,
'GroupID' => $GroupID,
'UserLoginName' => $user['username'],
'UserPassword' => $user['password']),
'UserEmail' =>
$user
['email'],
'UserFullName' => $user['name'],
'Title'=>'N/A',
'Company' => 'N/A',
'Address' => 'N/A',
'City' => 'N/A',
'Province' => 'N/A',
'ZipCode' => 'N/A',
'Phone' => 'N/A',
'CompanyURL' => 'N/A',
'SecurityQuestion' => 'N/A',
'SecurityAnswer' => 'N/A',
'IP' => $_SERVER['REMOTE_ADDR'],
'Money' => $Money,
'BindNumber' => $BindNumber,
'IsApproved' => 'yes',
'IsLockedOut' => 'no'
);
$result = $client->call('AddNewUser', array('parameters' => $param), '', '', true, true);
$message= $result['AddNewUserResult'];
?>
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:
nusoap.php class. Please download it from here: http://www.drm-x.com/download/nusoap.txt (rename the file name to php when you use the code)
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.