How to call third party web services from service now ?

soumya_c
Kilo Explorer

I am new to this and I have the follwoing integration to complete - Can any one please guide me how to proceed ?

 

On Incident create/edit/resolve - I need to trigger a call to 3rd Party WCF and update the incident details (Number, Short Desc, Opened, Assigned to, Priority) to the vendors application.

 

Need help :

1. How to get the events on Incident - Submit/ load/ update etc - Is that can be done from "Client Scripts " section.   May I do something like

function onSubmit() {

// My wcf service call goes here: Not sure how to call.

}

 

2. How to call SOAP web services from Service Now. Say I need to call this method -   PutProject

This also requires Basic Authentication. (UserName , password ) . If there is a way to pass cookie information , that 'll be good.

 

3. How to set some custom field values of Incident from a third party application - Say I want to add a Id to incident (which is retried from third party product.)Rob Woodbyrne Eric SchrederFred LuddyJeff HollingerBill Collins

 


9 REPLIES 9

marcguy
ServiceNow Employee
ServiceNow Employee

I have added a "OutBound Soap Message". I can see the output in test page. But I am not able to call the same from client script. here is my code snippet in client script



var s = new SOAPmessage('Replicon_ProjectService1', 'PutProject');


  s.setParameter('percentCompleted',0);


  s.setParameter('isTimeEntryAllowed',true);


  s.setParameter('targetname',g_form.getValue('short_description').toString());


  s.setParameter('isClosed',false);


  s.setParameter('code',g_form.getValue('number').toString());


  var response = s.post();


// parse response and do something



I have this "onSubmit" for Incident. when I submit   anew Incident I get the error that



onSubmit script error: ReferenceError: SOAPmessage is not defined:






marcguy
ServiceNow Employee
ServiceNow Employee

Try in a Business rule on update, I don't think SOAPmessage can be called like that in the client. I would get it working in a BR first.


marcguy
ServiceNow Employee
ServiceNow Employee

Or rather you would need to call it similar to this in the client... but firstly I would get it working server side.



  • var ajax = new GlideAjax('MySOAPCallAjax');  
  • ajax.addParam('sysparm_percentCompleted','xxxxxxxxxxxxxxx');//  
  • ajax.addParam('sysparm_isTimeEntryAllowed', xxxxxxxxxxx);  
  • showLoadingDialog();//Bring up a loading icon  
  • ajax.getXMLWait();  
  • var ans = ajax.getAnswer();