Sending big attachment through SOAP Message without converting it into String?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2019 09:11 AM
I'm trying to send a big attachment (around 40MB) through a SOAP Message. For doing this, I'm transforming it to base64 and then adding it to the respective parameter (via setStringParameter). The problem appears when this base64 is converted into a String, because it seems to exceed the limit size, throwing the following error:
Javascript compiler exception: String object would exceed maximum permitted size of 33554432
Is there any way to send this huge parameter without transforming it to string in memory?
Thank you very much in advance.
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 05:02 AM
Hi,
RESTMessageV2 has a method called setRequestBodyFromAttachment(attachmentSysId). Use this instead of setRequestBody. You can remove all of the code that calls GlideSysAttachment and just pass the Sys ID of the attachment to this method.
https://developer.servicenow.com/app.do#!/rest_api_doc?v=london&id=r_AttachmentAPI-POST
If my answer is helpful mark correct and helpful.
Regards,
Pratiksha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 05:12 AM
Hi,
RESTMessageV2 has a method called setRequestBodyFromAttachment(attachmentSysId). Use this instead of setRequestBody. You can remove all of the code that calls GlideSysAttachment and just pass the Sys ID of the attachment to this method.
https://developer.servicenow.com/app.do#!/rest_api_doc?v=london&id=r_AttachmentAPI-POST
If my answer is helpful mark correct and helpful.
Regards,
Pratiksha