Register| Login | FAQs | Contact Us
  
 Welcome 
 
 
 Demo 
 
 
 
 Support 
 


Using DRM-X XML Web service with ASP.net Guide

Overview:
DRM-X XML Web service provides the interface you can use DRM-X license service from your website.
It is very simple just call getLicenseRemote function, and provide several parameter, then DRM-X return license string for you.
The getLicenseRemote function needs the following parameters:


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.
ProfileID. ProfileID is the License Profile ID. DRM-X provides this parameter.
ClientInfo. ClientInfo is the basic client information of user. DRM-X provides this parameter.
RightsID. RightsID is the ID of rights that you created in your DRM-X Accounts. You can find RightsID value in Rights of DRM-X Accounts.
UserLoginName. UserLoginName is the username or unique UserID 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.
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.
Message.  Message is the license information, like license rights information returned from DRM-X web service.
IP.  IP is the IP address of your user which acquire license. You can provide this Parameter.

After you call getLicenseRemote function, it will return License Value to you.

STEP BY STEP INSTRUCTIONS

Step 1: 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.
Step 2 :Then you can create a login page for drm called drmlogin.aspx.

Here is the sample code:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Dim AdminEmail As String 'AdminEmail is your login Email of Media-DRM Account.
        Dim WebServiceAuthStr As String 'WebServiceAuthStr is the Web Service Authenticate String for DRM-X web service. You can set this value in Profile - Website Integration Preferences of your Media-DRM Account.
        Dim ProfileID As String = Request.Form("profileid") ' Get profileid from DRM-X.
        Dim clientinfo As String = Request.Form("clientinfo") 'Get clientinfo from DRM-X.
        Dim rightsID As String 'RightsID is the ID of rights that you created in your DRM-X Accounts. Your can find RightsID value in Rights of DRM-X Accounts.
        Dim UserLoginName As String 'UserLoginName is the username or unique UserID in your user database.
        Dim UserFullName As String '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 '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 LicenseValue As String '

        'Assign value to these variables according to your DRM-X account settings.

       '  Response.Write(ProfileID & " - " & clientinfo)
        Dim DRMService As New drm.HaihaisoftLicenseService

        LicenseValue = DRMService.getLicenseRemote(AdminEmail, WebServiceAuthStr, ProfileID, clientinfo, rightsID, UserLoginName, UserFullName, GroupID, Message, IP)
        Response.Write(Message & LicenseValue)

End Sub
       
Step 3: Run drmlogin.aspx page. Because you need the ProfileID and ClientInfo parameter from DRM-X, you need to open your encrypted media files to run drmlogin.aspx. Make sure you set the License URL drmlogin.aspx in the Profile - Website Integration Preferences of your DRM-X account. If it returns Message and LicenseValue, then we go to step 4. If it fails, please check all the parameters, and try again.

Step4. Store license for End user, and display Message.

Let us comment 'Response.Write(Message & LicenseValue), and set Message and LicenseValue in Session.

  ' set Message and LicenseValue in Session, and redirect to LicStore.aspx to deliver license to End User.
        Session("Message") = Message
        Session("LicenseValue") = LicenseValue
        Response.Redirect("LicStore.aspx")

Create a new page LicStore.aspx to deliver license to End User. The page name must contains LicStore. If you choose PHP or JSP, the page name should be LicStore.php or LicStore.jsp.


In the LicStore.aspx page enter:
<html>
 <head>
  <%=License%>
 </head>
 <body>
  <% =Message %>
 </body>
</html>


In the StoreLicense.aspx.vb page enter:

   Public Message, LicenseValue As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Message = Session("Message")
        LicenseValue = Session("LicenseValue")
End Sub

Step 5. Run drmlogin.aspx page. Because you need the ProfileID and ClientInfo parameter from DRM-X, you need to open your encrypted media files to run drmlogin.aspx. Make sure you set the License URL drmlogin.aspx in the Profile - Website Integration Preferences of your DRM-X account.
If the Play button in Haihaisoft Universal Player works, it means all use DRM-X service successfully. Please make sure all the parameters you have provided are correct, and matched the settings in your DRM-X account.

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



Was this information helpful?

You may also be interested in...
How does DRM-X protect digital content?
What if I don't have a Web site, but still want to publish media via the Internet?
Step 1: Register a DRM-X Account
Does DRM-X require long-term contracts?
How many websites can I integrate with DRM-X?
 Search Help Center
 
 
 Troubleshooting Tools
  Integrate with your system
 Top 25 Articles

  • Using DRM-X XML Web service with ASP.net Guide


  • How does DRM-X protect digital content?


  • Who is DRM-X for?


  • Does DRM-X require long-term contracts?


  • What if I don't have a Web site, but still want to publish media via the Internet?



  • See all 25...
     Look Up Terminology
      Glossary

    DRM-X Home - About Us - End User Account - Fees - Contact Us - Privacy Statement - DRM-X China - Media-DRM.com
       © Copyright 2004-2008 Haihaisoft Corporation