Automation with Perl SOAP XML

I’m always looking for ways to help automate the environment around me. I was recently asked to investigate how we could integrate our internally developed applications into our installation of CA Service Desk. I looked at the integration offered by Maileater but I wanted the ability to record/track the ticket numbers and handles for any tickets, incidents, requests or changes we were opening within Service Desk. I discovered that I could make SOAP/XML calls directly against the application, as long as I ordered the data properly and provided the correct bits and bytes. The value in tracking the ticket number and handle comes when you want to automatically acknowledge/close previously open tickets or if you might want to re-open previously closed tickets or requests when some condition is met.

I should note that the Service Desk Users forum was a big help in my initial research and already has a number of code snippets available on their site.

Here’s a quick Perl script that demonstrates how to interface with CA Service Desk via SOAP/XML calls. This specific script will create an Incident (type = crt:182) assigned to the group Help Desk ( group = 9C4E34BDF796B04DBAD365034FC92288) with the problem category of Alarms (category = pcat:400978) and set the reporting method to Other ( zreporting_method = i:7304).

The values above are specific to my installation of CA Service Desk, you may need to adjust the values for your specific environment and installation. You will also need to substitute a valid username and password that has access to Service Desk in the variables $USERNAME and $PASSWORD. You will also need to update the $wsdl variable to reference the hostname or IP address of the CA Service Desk application server.

You’ll note that I’m using a number of Perl modules to make life easy. You’ll need to have these Perl modules installed in order for the script to run properly. You can install the modules with the following commands assuming you are running CentOS/RedHat Linux;