Register| Login | FAQs | Contact Us

 Welcome 
 
 
 Demo 
 
 
 
 Support 
 


Using Media-DRM XML Web service with PHP Guide Pre-deliver License

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.

With Media-DRM web service, you can pre-deliver licenses to users through IE browser.

STEP BY STEP INSTRUCTIONS

STEP 1. Create a clientinfo.html, get client computer's information.

<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
 
function doSubmit()
{
document.predeliver.clientinfo.value = netobj.GetSystemInfo();
document.predeliver.DRMVersion.value = netobj.GetDRMVersion();
document.predeliver.DRMSecurityVersion.value = netobj.GetDRMSecurityVersion();
document.predeliver.submit();
}
</SCRIPT>
</head>

<body onLoad="doSubmit()">
<OBJECT classid=clsid:A9FC132B-096D-460B-B7D5-1DB0FAE0C062 height=0 id=netobj width=0 VIEWASTEXT>
</OBJECT>
<form name="predeliver" action="getlicense.php" method="post">
<INPUT type="hidden" name="clientinfo" >
<INPUT type="hidden" name="DRMVersion" >
<INPUT type="hidden" name="DRMSecurityVersion" >
</form>
</body>
</html>

STEP 2. The clientinfo.html will submit the parameters to getlicense.php. The getlicense.php get all the parameters, and then it will call Media-DRM web service to get a license.


<?php
 session_start();
 require_once('nusoap.php');

 $wsdl="http://www.media-drm.com/haihaisoftlicenseservice.asmx?wsdl";
 $client=new soapclient2($wsdl, 'wsdl');
 $client->soap_defencoding = 'UTF-8';
 $client->decode_utf8 = false;

 //Please replace the following parameters value with your own Media-DRM account value.

 $param = array(
    'AdminEmail' => "sample@sample.com",
    'WebServiceAuthStr' => "123456",
    'ProfileID' => "3438",
    'ClientInfo' =>$_POST['clientinfo'],
    'RightsID' => "626",
    'UserLoginName' => "testuser",
    'UserFullName' => "N/A",
    'GroupID' => "488",
    'IP' => "192.168.1.200",
    'Message' => "",
               );
 $result = $client->call('getLicenseRemote', array('parameters' => $param), '', '', true, true);
 $license= $result['getLicenseRemoteResult'];
 print_r('<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><Script Language="JavaScript">function storeLic(){netobj.StoreLicense("'.    $license . '");}</Script></head><body onLoad="storeLic()"><object id=netobj CLASSID="clsid:A9FC132B-096D-460B-B7D5-1DB0FAE0C062" width=0 height=0></object>Message: ' . $result['Message']  . '</body></html> ');
?>

After you created clientinfo.html and getlicense.php. You can let your website run clientinfo.html after your customer pay you successfully. They will get a license immediately.

You can download sample code from here:

http://www.media-drm.com/download/php_pre-deliver-license.zip

Please remember modify the parameters. You can get them from your own Media-DRM account.




Was this information helpful?

You may also be interested in...
Using Media-DRM XML Web service with ASP.net Guide
How many websites can I integrate with Media-DRM?
How does Media-DRM enable DRM works with my existing Web site and user accounts?
How does Media-DRM protect digital content?
What if I don't have a Web site, but still want to publish media via the Internet?
 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


  • Who is Media-DRM for?


  • 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?


  • Does Media-DRM require long-term contracts?



  • 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