cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post

Integration with Remedy

Does anyone use the Remedy Web Services as the interface with Orion? If so, what is the configuration setup?

20 Replies
Level 7

Were you ever able to figure out how to do this?  I have this very need.  I was provided with the Remedy WSDL, but I need to figure out how to call it when one of my switches goes down to create a ticket.

If anyone has any ideas on this, it would be greatly appreciated.

 

 

Thanks.

0 Kudos

First start with a WSDL / SOAP test tool. I like the following:

  • http://storm.codeplex.com/
  • http://www.crosschecknet.com/download/p_cust_info_try_p.php

NOTE: the WSDL is specific to our implementation. Change it to match yours.
NOTE: the parameters are specific to our implementation. Change it to match yours.
NOTE: I only fill in the mandatory fields to get a ticket cut.

Here is a php test script I used to work with the WSDL exposed by our Remedy support staff.

 

Kinda crude and brute force, but it worked.

<?php

$myargs = getArgs($_SERVER['argv']);

foreach (array('u','p','g','c','o','f','l','s') as $arg) {
    if (!isset($myargs[$arg])) {
            echo "usage $argv[0] -u 'username' -p 'userpassword' -g 'group name as shown in ars' -c 'opcat1:opcat2:opcat3' -o 'prodcat1:prodcat2:prodcat3' -f 'firstname' -l 'lastname' -s 'summary field text'\n";
            exit;
    }
}
$opcats = split(":",$myargs['c']); print_r($opcats);
$prodcats = split(":",$myargs['o']); print_r($prodcats);

$params->Assigned_Group=$myargs['g'];
$params->Assigned_Group_Shift_Name='';
$params->Assigned_Support_Company='Liquids Pipelines';
$params->Assigned_Support_Organization='Liquids Pipelines';
$params->Assignee='';
$params->Categorization_Tier_1=$opcats[0];
$params->Categorization_Tier_2=$opcats[1];
$params->Categorization_Tier_3=$opcats[2];
$params->CI_Name='';
$params->Closure_Manufacturer='';
$params->Closure_Product_Category_Tier1='';
$params->Closure_Product_Category_Tier2='';
$params->Closure_Product_Category_Tier3='';
$params->Closure_Product_Model_Version='';
$params->Closure_Product_Name='';
$params->Department='';
$params->First_Name=$myargs['f'];
$params->Impact='4-Minor/Localized';
$params->Last_Name=$myargs['l'];
$params->Lookup_Keyword='';
$params->Manufacturer='';
$params->Product_Categorization_Tier_1=$prodcats[0];
$params->Product_Categorization_Tier_2=$prodcats[1];
$params->Product_Categorization_Tier_3=$prodcats[2];
$params->Product_Model_Version='';
$params->Product_Name='';
$params->Reported_Source='Direct Input';
$params->Resolution='';
$params->Resolution_Category_Tier_1='';
$params->Resolution_Category_Tier_2='';
$params->Resolution_Category_Tier_3='';
$params->Service_Type='User Service Request';
$params->Status='New';
$params->Action='CREATE';
$params->Create_Request='Yes';
$params->Summary=$myargs['s'];
$params->Notes='';
$params->Urgency='4-Low';
$params->Work_Info_Summary='';
$params->Work_Info_Notes='';
$params->Work_Info_Type='----- Customer Inbound -----';
$params->Work_Info_Date='';
$params->Work_Info_Source='Email';
$params->Work_Info_Locked='Yes';
$params->Work_Info_View_Access='Internal';
$params->Middle_Initial='';

//test
//$ars = new SoapClient('http://hostname:8080/arsys/WSDL/public/HPD_IncidentInterface_Create_WS');

//dev
//$ars = new SoapClient('http://hostname:8080/arsys/WSDL/public/HPD_IncidentInterface_Create_WS');

// prod
$ars = new SoapClient('http://hostname:8080/arsys/WSDL/public/HPD_IncidentInterface_Create_WS');

$auth->userName=$myargs['u'];
$auth->password=$myargs['p'];
$authvalues = new SoapVar($auth, SOAP_ENC_OBJECT);
$header =  new SoapHeader('name_space', "AuthenticationInfo", $authvalues, false);

$ars->__setSoapHeaders(array($header));

$result = $ars->HelpDesk_Submit_Service($params);
var_dump($result);

function getArgs($args) {
    $out = array();
    $last_arg = null;
    for($i = 1, $il = sizeof($args); $i < $il; $i++) {
        if( (bool)preg_match("/^--(.+)/", $args[$i], $match) ) {
            $parts = explode("=", $match[1]);
            $key = preg_replace("/[^a-z0-9]+/", "", $parts[0]);
            if(isset($parts[1])) {
                $out[$key] = $parts[1];
            } else {
                $out[$key] = true;
            }
            $last_arg = $key;
    } else if( (bool)preg_match("/^-([a-zA-Z0-9]+)/", $args[$i], $match) ) {
        for( $j = 0, $jl = strlen($match[1]); $j < $jl; $j++ ) {
            $key = $match[1]{$j};
            $out[$key] = true;
        }
        $last_arg = $key;
    } else if($last_arg !== null) {
        $out[$last_arg] = $args[$i];
    }
    }
    return $out;
}

?>

0 Kudos

Thanks for that info.  I have been playing with soapUI to get all the fields correct for creating a ticket, so I know all the fields I need now.

 

How are you calling this PHP from Solarwinds?  Do you have PHP installed on your Solarwinds server?

 

 

Thanks.

0 Kudos

How are you calling this PHP from Solarwinds?  Do you have PHP installed on your Solarwinds server?

 

Yes, I've installed PHP 5.x on the server and use the CLI interface.

 

To call it, I do alert action of "run an external program" like this:

 

C:\Program Files (x86)\PHP\TelAlert\php.exe c:\remedy.php  -u username -p password -g "Monitoring" -c Request:Service:Create -o "Software:IT Software:Monitoring" -f firstname -l lastname -s "cmdline soap testing from Orion"

0 Kudos

Thanks for that info. That helps out.  Is this your entire code?  It seems maybe it is missing an object definition for "$params."  Or should $params be an array using => instead of ->?  Maybe I am just completely missing something.

 

Thanks.

0 Kudos

php doesn't require variable definition before use unless you do something like a "use strict". I don't do that.

You are right that $params is an array. If there was a statement @ the top that said $params = array(); that would make it more clear.

I'm lazy and you code in a different language (and probably aren't lazy!)

0 Kudos

Not a problem.  I think I pretty much have it.  One more question, what is HelpDesk_Submit_Service()?  Is that something you have defined or is that one of the functions from your Remedy?  In my SOAP client, I use OpCreate to create a ticket.  I tried just changing HelpDesk_Submit_Service() with OpCreate(), but I get an error that "CLI has stopped working."

Also, what are you using for 'namespace' in your SoapHeader() call?  That may be my problem.  Is this the same URL you are using when creating a new SoapClient()?

 

Thanks for your help on this.

0 Kudos

HelpDesk_Submit_Service() is the SOAP function that is exposed in the WSDL that the remedy support people setup. They can name it whatever they want. In my case they named it the same as a Remedy workflow function they use.

 

NOTE: the exposed Remedy function can only be used for SUBMITTING a ticket (in my case).  The remedy people need to expose another WSDL so I can update an existing ticket or close a ticket.

 

If you open the WSDL with something like SOAPSonar, you will see something like this. When you fill in the fields as required by Remedy and whack the button circled in red, the SOAP request is set back to the server.

 

In my case it will invoke a serverside SOAP function named HelpDesk_Submit_Service()

0 Kudos

Excellent.  I loaded up that tool to get some more information.  Unfortunately we are using https, which is not supported in the Personal Edition.  However, I am using soapUI, and I am able to successfully submit a request and create a ticket.  When I use the PHP code from the command line, however I get "CLI has stopped working" (see below).  Most of the code works, as I am printing out my arrays, but it seems to be the call to OpCreate in my case (HelpDesk_Submit_Service) in your case.

1.  What do you have for 'nameservice'  when creating your new SoapHeader() or where can I find this in SOAPSonar (I can view, just not submit anything)?

2.  Any ideas what might be causing this to crash like it is?

 

Thanks for your patience and help.  I think I am almost there!

0 Kudos

I usually run it from a dos box so I can see the output. I'm not sure if that makes a difference.

 

Also do a "php -m" and make sure the "soap" module is in your installation

 

I also have the following pear modules installed:

 

C:\Program Files (x86)\PHP>pear list
INSTALLED PACKAGES, CHANNEL PEAR.PHP.NET:
=========================================
PACKAGE          VERSION STATE
Archive_Tar      1.3.3   stable
Console_Getopt   1.2.3   stable
PEAR             1.9.0   stable
Structures_Graph 1.0.2   stable
XML_Util         1.2.1   stable

The Console_Getopt handles the command line stuff and is required if you use the script from the command line

 

<chris>

0 Kudos

I do have the SOAP module installed.  However, I will look at getting PEAR installed with the console_getopt module.  Just for my information, what version of PHP are you running?

0 Kudos

Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\>php -v
PHP 5.3.2 (cli) (built: Mar  3 2010 20:47:01)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

0 Kudos

I am running the same version.  I disabled the use of all the command-line stuff for now, and that helped.  It shows some warnings and seems to run.  However, immediately after the line:

$result = $ars->OpCreate($params);

 

It still bombs out on me without giving an error except the screen shot I posted earlier.  Any thoughts?

0 Kudos

No idea. sorry.

I would suggest translating my php code into a language you use on a regular basis. That always helps me.

0 Kudos

I am fairly familiar with PHP; I just have never used it to consume a WSDL.  I have started running the code through my web browser in order to get better output.  It turns out I was missing some of the parameters in my $params array.  After putting all those in there with null values, I have overcome that hurdle.  Now, however I am getting:

Fatal error: Uncaught SoapFault exception: [soapenv:Server.userException] ERROR (8961): Required element expected in the input XML document; in C:\inetpub\wwwroot\opCreate3.php:89 Stack trace: #0 [internal function]: SoapClient->__call('OpCreate', Array) #1 C:\inetpub\wwwroot\opCreate3.php(89): SoapClient->OpCreate(Object(stdClass)) #2 {main} thrown in C:\inetpub\wwwroot\opCreate3.php on line 89 

It appears there is a missing element that is required, but unlike when I was missing some parameters, nothing is specified.  This is what I am troubleshooting now if anyone has seen this or has any ideas.

0 Kudos

This is familiar to me.

Talk to your Remedy admins and have them identify which fields are MANDATORY in the WSDL. The error means you have not passed data back for all mandatory fields.

 

Chris.

0 Kudos

Alright.  I am checking with my Remedy folks now.

 

What do you have for 'name_space' in your code?  Do you have that code or is that something specific to your instance?  If the latter is true, where in my SOAP client can I find that information?

 

 

Thanks.

0 Kudos

I don't understand what you mean by "name_space". I think that might be something remedy-ish ?

0 Kudos

It was in one of the original lines of your code.

The line was:$header = new SoapHeader('name_space', "AuthenticationInfo", $authvalues, false);

 

Thanks.

0 Kudos

It turns out that my Remedy admin had changed some things.  After verifying the changes, I was still having issues.  However, I disabled SOAP caching in my PHP.ini files with these two lines:

 

soap.wsdl_cache_enabled=0

soap.wsdl_cache_ttl=1

 

 After doing so, all is good!  Thanks for all the help.  I really appreciate it!

0 Kudos