#!/usr/local/bin/perl 
use Net::DSML;
use Net::DSML::Filter;
use Net::DSML::Control;

# 
# Be sure to set up the first line to point to your perl executable location.
#
# Fill in the server variable with a value that matchs your configuration.
#
# 
# This example does a rootDSE search and returns information about the 
# requested attributes.
# 
my $server = "http://dsml.yourcompany.com:8080/dsml";
 
   #
   #  We are going to do a root DSE data search now
   #
   #  Also going to specify a specific batch requestID.
   #
   $webdsml = Net::DSML->new(  { url => $server, bid => "123" } );

   #Create a list of attributes that we want.
   @name = ();
   push(@name,"namingContexts");
   push(@name,"supportedLDAPversion");
   push(@name,"vendorName");
   push(@name,"vendorVersion");
   push(@name,"supportedSASLMechanisms");

   if (!($webdsml->rootDSE( { attributes => \@name } )))
   {
      print "RootDSE error.\n";
      print $webdsml->error, "\n";
      exit;
   }

   if (!($webdsml->send()))
   {
      print "RootDSE send request error.\n";
      print $webdsml->error(),"\n";
      exit;
   }

   
# get the return xml content, there may not be any.
$postData = $webdsml->content();
print $postData, "\n"; # print the xml data.

