How to sent attachments to service now from soap webservice (via PLSQL)?

krishmur78
Kilo Contributor

We have an requirement where we need to sent attachment in the incident created in service now from soap web service.

4 REPLIES 4

anjalichoudhary
Kilo Guru

Hi Murali,



These below links will help you to retrieve attachments in ServiceNow sent from external source:



How to retrieve an attachment from service now via SOAP Web Service


Getting an attachment through web service response


http://wiki.servicenow.com/index.php?title=AttachmentCreator_SOAP_Web_Service#gsc.tab=0



Hope it will help!!



Regards,


Anjali


Hello Anjali,



Thanks for the reply.



I am not trying to fetch the file.



We want to attach a file in incident in service now using web service.


I am creating an incident using web service and want to attach a file to that incident.




Please let me know how to achieve that.


Hi Murali,



Could you please clear me here what you are trying two achieve. There are only two cases:


1) Either you are receiving file from external source via web service and you have to attach that file on incident in servicenow, OR


2) You have attached a file on an incident in ServiceNow only and you have to send that file on incident created in external source as well.



Which one is yours requirement? If it is first one than above links provided will help you to achieve it and if its second one in which you have to send attachment via web service, below links will help you:



Sending attachment with outbound SOAP message


sending attachment through outbound web service


OutBound Rest Message with a attachment


http://wiki.servicenow.com/index.php?title=AttachmentCreator_SOAP_Web_Service#gsc.tab=0



Hope it will help!!



Regards,


Anjali


Alikutty A
Tera Sage

Hi Murali,



You need to call a second web service to attach a file on the incident which you have created.



The WSDL would be https://instance_name.service-now.com/ecc_queue.do?WSDL   // Replace instance name with yours



You should call the insert method of this WSDL and pass these parameters in your SOAP message call.



agent: "AttachmentCreator"


topic: "AttachmentCreator"


name: "your_file_name.xls:application/vnd.ms-excel"     //This should contain your file name and content type


source:   "incident:sys_id_of_incident_record"   //This should contain the table name and sys_id of record where attached should be added


payload:   "x1232wdfffff"     //This should be the base 64 encoded string of your attachment



Here are further details on parameters to pass in your SOAP insert call


http://wiki.servicenow.com/index.php?title=AttachmentCreator_SOAP_Web_Service#Overview



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response