Integrate with DRM-X - Synchronize Users to DRM-X Platform Java 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

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

Here is the sample cod
<%@ page contentType="text/html; charset=gb2312" language="java"%>
<%@ page import="org.apache.axis.client.Service,org.apache.axis.client.Call,javax.xml.namespace.QName,org.apache.log4j.Level"%>
<%
 
  String AdminEmail = "youremail@yourmail.com"; 
  String WebServiceAuthStr="your_auth_str_Set_At_DRM"; 
  String GroupID = "6041"; 
  String  UserLoginName = "huxiao232";
  String  UserPassword = "1181182";
  String  UserEmail="test@great233.com";
  String  UserFullName = "testuser4";
  String  Title="N/A";
  String  Company="N/A";
  String  Address="N/A";
  String  City="N/A";
  String  Province="N/A";
  String  ZipCode="N/A";
  String  Phone="N/A";
  String  CompanyURL="N/A";
  String  SecurityQuestion="N/A";
  String  SecurityAnswer="N/A";
  String  IP = "192.168.7.43";
  String  Money="0";
  String  BindNumber="0";
  String  IsApproved="yes";
  String  IsLockedOut="no"; 
  String namespace="http://tempuri.org/ASPNET.StarterKit.Commerce/HaihaisoftLicenseService";

  try {        
        String endPoint="http://cn.drm-x.com/haihaisoftlicenseservice.asmx?wsdl";
        Service service = new Service();
        Call call = (Call)service.createCall();
       
        call.setTargetEndpointAddress(new java.net.URL(endPoint));
       
        call.setOperationName(new javax.xml.namespace.QName("http://tempuri.org/ASPNET.StarterKit.Commerce/HaihaisoftLicenseService", "AddNewUser"));
       
       
         call.addParameter(new QName(namespace,"AdminEmail"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"WebServiceAuthStr"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"GroupID"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"UserLoginName"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"UserPassword"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"UserEmail"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"UserFullName"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"Title"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"Company"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"Address"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.INOUT);
          call.addParameter(new QName(namespace,"City"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"Province"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"ZipCode"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"Phone"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"CompanyURL"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"SecurityQuestion"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"SecurityAnswer"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"IP"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"Money"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"BindNumber"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.addParameter(new QName(namespace,"IsApproved"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.INOUT);
          call.addParameter(new QName(namespace,"IsLockedOut"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
          call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
          call.setUseSOAPAction(true);
          call.setSOAPActionURI("http://tempuri.org/ASPNET.StarterKit.Commerce/HaihaisoftLicenseService/AddNewUser");

     
          Object[] param={new String(AdminEmail),new String(WebServiceAuthStr),new String(GroupID),new String(UserLoginName),new String(UserPassword),new String(UserEmail),new String(UserFullName),new String(Title),new String(Company),new String(Address),new String(City),new String(Province),new String(ZipCode),new String(Phone),new String(CompanyURL),new String(SecurityQuestion),new String(SecurityAnswer),new String(IP),new String(Money),new String(BindNumber),new String(IsApproved),new String(IsLockedOut)};
     
         String temp = (String)call.invoke(param);
      
         out.println("call.invoke(param):" + call.invoke(param));
     
  } catch (Exception e) {   
      e.printStackTrace();
  } 
 
%>



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.

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 PHP Guide (Call getLicenseRemote function)
Integrate with DRM-X - Synchronize Users to DRM-X Platform PHP Guide (Call AddNewUser function)
How many websites can I integrate with DRM-X?
Integrate with DRM-X - Custom Login Page Integration ASP.net VB Guide (Call getLicenseRemote function)
Integrate with DRM-X - Add Money to DRM-X Users PHP Guide (Call UserAddMoney function)


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