Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..
371 views

HPSM Javascript to update tickets using SOAP

Hi Experts,
I need your help please.

Can anyone send me a javascript to be triggered to update tickets from HPSM to another system using SOAP API (the other system can be also HPSM).

Can you please help me with this? 

Thanks

0 Likes
3 Replies
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: HPSM Javascript to update tickets using SOAP

There are several examples in SM already, and there should also be a guide out there somewhere. Essentially, you import the WSDL (convert WSDL to JavaScript) and then create the message(s) you need to send by calling the functions in that Script from other JS places.

0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: HPSM Javascript to update tickets using SOAP

Hey Josh_MM,

Thank you for your reply.
I understand that, but can you please help me if you have a sample javascript that will be triggered whenever we want to update a ticket in another system? 

Does anyone have any sample script? 

Please.

Thanks

0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: HPSM Javascript to update tickets using SOAP

An example of the outgoing call is (modified to be generic).

In a formatctrl:

$L.junk=externalSystem.sendMessage(custom_key in $L.file, "", $L.file, cartID in $L.file, $L.file0)

 

The code for sendMessage (simplfied, and without proper error handling) in ScriptLib "externalSystem"):

function sendMessage(Key_ID, strTopic_ID, fRecord, fCartItem, fRecordOld )
{
 var  strLocation = "http://server:port/ws_loc/blah";
 var strUser = "name";
 var strPwd = "pw";
 var aService = new lib.TaskService.TaskService();
 aService.location = new String( strLocation );
  
 if ( strUser != null && strUser != "" )
  aService.user     = ( strUser );

 aService.password = ( strPwd );

 // Invoke the service and create response
  var th = aMessage;
  var aResponse = aService.invoke( aMessage );
  return true;
}
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.