NAME


NAME

DSML-RPC (Directory Service Markup Language RPC)


SYNOPSIS


 use XML::Parser;
 use DSML;
 my $parser =  new XML::Parser();
 $parser->setHandlers( Start => \&start,
                       End => \&end,
                       Char => \&char);
 
 $parser->parse($dsml);
 
 my $obj = GetRequest();
 
 ....
 # Do LDAP operation
 ....
 
 ErrorResponse($msg->error_name, $msg->error_text) if ($error);
 # Request isn't search
 GeneralResponse($obj->reqType, $msg->code, $msg->error_name) unless($error);
 
 # Request is search
 SearchResponse($msg);


DESCRIPTION


This module use XML::Parser to parse DSML document and build a structure which contain
all element to make requests to an LDAP server.


METHODS

start

This is the handler for XML::Parser Start.

end

This is the handler for XML::Parser End.

char

This is the handler for XML::Parser Char.

GetRequest

Return an DSML::Request object which contains information to make LDAP operation. This object is created during parsing of XML.

GetResponse

Return a scalar which contains result of LDAP operation. It is in 
XML.
ErrorResponse (NAME, MESSAGE)

If LDAP operation returns an error, this method build an XML
that contains name of error and a short descrption of it.
SearchResponse (SEARCH)

This method get in input a Net::LDAP::Search object returned by Net::LDAP 
search method and build an XML from it.
GeneralResponse (TYPE, CODE, MESSAGE)

This method build an XML for other LDAP Operation. It get type of operation (modifyRequest, addRequest, delRequest, ...), result code and a short description of it.


SEE ALSO

the Net::LDAP manpage, the XML::Parser manpage


NOTES

This module is based on DSMLv2.xsd contained in this distribution. I made some changes to original XML schema definition because I needed information about host, port (to contact LDAP server), username and password (to authenticate on LDAP server).


AUTHOR

Sevastian Foglia <sf@yacme.com> YACME s.r.l. <http://www.yacme.com>


COPYRIGHT

Copyright (c) 2004 YACME s.r.l. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.