Sending big attachment through SOAP Message without converting it into String?

Iv_n Carravilla
Kilo Contributor

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.
6 REPLIES 6

Alikutty A
Tera Sage

Hi,

Please try to send your data in the request body if it is too big by using the setRequestBody function of SOAPMessageV2

https://docs.servicenow.com/bundle/madrid-application-development/page/app-store/dev_portal/API_refe...

Thanks!

Hi,

 

I have tried using setRequestBody but the parameter needed is a string and it throws the same error when I try to transform the base64 into String.

 

Is there anyway of sending the message without transform it into a String?

 

Thank you!

toshitbhatt
Kilo Contributor

@Iván Carravilla: Did you get any solution for this?

 

Hi,

I couldn't find a way of sending it as a whole piece. I had to chop it into fewer parts and then rebuild them once received.

 

Sorry 😕