Register| Login | FAQs | Contact Us

 Welcome 
 
 
 Demo 
 
 
 
 Support 
 


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

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


AdminEmail. AdminEmail is your login Email of Media-DRM Account.
WebServiceAuthStr. WebServiceAuthStr is the Web Service Authenticate String for Media-DRM web service. You can set this value in Profile - Website Integration Preferences of your Media-DRM Account.
ProfileID. ProfileID the License Profile ID or the Encoder Profile ID. Media-DRM provides this parameter.
ClientInfo. ClientInfo is the basic client information of user. Media-DRM provides this parameter.
RightsID. RightsID is the ID of rights that you created in your Media-DRM Accounts. You can find RightsID value in Rights of Media-DRM 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 Media-DRM Accounts. You can find GroupID value in Users Group of Media-DRM Accounts.
Message.  Message is the license information, like license rights information returned from Media-DRM 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.media-drm.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 Media-DRM 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 Media-DRM.
        Dim clientinfo As String = Request.Form("clientinfo") 'Get clientinfo from Media-DRM.
        Dim rightsID As String 'RightsID is the ID of rights that you created in your Media-DRM Accounts. Your can find RightsID value in Rights of Media-DRM 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 Media-DRM Accounts. Your can find GroupID value in Users Group of Media-DRM Accounts.
        Dim Message As String ' Message is the license information, like license rights information returned from Media-DRM web service.
        Dim LicenseValue As String '

        'Assign value to these variables according to your media-drm settings.

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

        LicenseValue = DRMService.getLicenseRemote("yourlogin@yourwebsite.com", "joseph", ProfileID, clientinfo, 57, "WebServiceAuthStr", "test", 6, Message, "192.168.1.103")
        Response.Write(Message & LicenseValue)

End Sub
       
Step 3: Run drmlogin.aspx page. Because you need the ProfileID and ClientInfo parameter from Media-DRM, 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 media-DRM 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 StoreLicense.aspx to deliver license to End User.
        Session("Message") = Message
        Session("LicenseValue") = LicenseValue
        Response.Redirect("StoreLicense.aspx")

Create a new page StoreLicense.aspx to deliver license to End User.
In the StoreLicense.aspx page enter:
<html>
 <head>
  <Script Language="JavaScript">function storeLic(){netobj.StoreLicense("<% =LicenseValue %>");
}
  </Script>
 </head>
 <body onLoad="storeLic()">
  <object id="netobj" CLASSID="clsid:A9FC132B-096D-460B-B7D5-1DB0FAE0C062" width="0" height="0"
   VIEWASTEXT>
  </object>
  <% =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 Media-DRM, 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 media-DRM account.
If the Play button in Windows Media Player or Real Player works, it means all use Media-DRM service successfully. Please make sure all the parameters you have provided are correct, and matched the settings in your Media-DRM account.



Was this information helpful?

You may also be interested in...
What if I don't have a Web site, but still want to publish media via the Internet?
How does Media-DRM protect digital content?
How many websites can I integrate with Media-DRM?
Who is Media-DRM for?
How does Media-DRM enable DRM works with my existing Web site and user accounts?
 Search Help Center
 
 
 Troubleshooting Tools
  Integrate with your system

  Haihaisoft Drm Check Up
 Top 25 Articles

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


  • Media-DRM support "renewability"?


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


  • Who is Media-DRM for?


  • How does Media-DRM protect digital content?



  • See all 25...
     Look Up Terminology
      Glossary

    © 2007 Media-DRM.com - Media DRM Home - About Us - End User Account - Fees - Contact Us - Privacy Statement - Media-DRM China - Haihaisoft