Perl API architecture

This reference explains the Perl API architecture.

Figure 1. Perl API overview

At the top most of the class hierarchy is the module. This module provides direct subroutines that delegate down into subroutines of the object heirarchy, providing a convenient calling convention if object oriented Perl programming is not a desired practice.

ITIL Objects

The next layer of the class hierarchy contains the ITIL Objects for example, and These objects extend the object which inherits from the object.

To use the Perl API, the programmer instantiates a object and sets the service endpoint as well as the login credentials to use the API. For example:
my $CONFIG = ServiceNow::Configuration->new();

my $incident = ServiceNow::ITIL::Incident->new($CONFIG);

The class defines the interfaces for making the SOAP calls to the platform. The default implementation uses the SOAP::Lite module, if you wish to implement your own SOAP interface, you can override this class with your own and implement the following subroutines:
  • new
  • open
  • send
  • close
If running behind a firewall, edit to specify information about the HTTP proxy. In, change the line:
$me->{'SOAP'} = SOAP::Lite->proxy($CONFIG->getSoapEndPoint($target));
$me->{'SOAP'} = SOAP::Lite->proxy($CONFIG->getSoapEndPoint($target), proxy => ['https' => '']);
Substitute the appropriate proxy URL.