1#!/usr/bin/perl -w 2# 3# A Net::DRI example 4 5use strict; 6 7use Net::DRI; 8 9my $dri=Net::DRI->new(); 10 11eval { 12 13## You need 14## 1) to download Domain-perl.wsdl and put it in the same path (or correct the URI in service_wsdl), 15## as well as the certificate file, with name afnic-ca.crt (or change the name in ssl_ca_file) 16## 2) to replace USERNAME and PASSWORD with your credentials at AFNIC. 17 18$dri->add_registry('AFNIC', { clid => 'USERNAME' }); 19$dri->target('AFNIC')->add_current_profile('profile1','ws',{proxy_url=>'https://soap-adh.nic.fr/',service_wsdl=>{Domain=>'file:./Domain-perl.wsdl'},ssl_ca_file=>'./afnic-ca.crt',credentials=>['soap-adh.nic.fr:443','Webservices Adherents AFNIC','USERNAME','PASSWORD']}); 20 21my $rc=$dri->domain_check('toto.fr'); 22print "Is success : ".$rc->is_success()."\n"; 23print "Object exists : ".($dri->get_info('exist','domain','toto.fr')? 'YES' : 'NO'); 24print "\n"; 25}; 26 27if ($@) 28{ 29 print "AN ERROR happened !!!\n"; 30 $@->print(); 31} else 32{ 33 print "No error"; 34} 35 36print "\n"; 37 38exit 0; 39