Extract SOAP attachment response to JSON

Not applicable

Hi,

I was building proxy to expose SOAP Target as REST API. SOAP response will have XML payload and attachment as application/octet-stream (XOP/MTOM) content type. My requirement is to convert the Payload and Attachment binary as JSON. any built in policy options available? Thanks in advance.

0 3 649
3 REPLIES 3

Not applicable

I don't think there is a built-in policy that can do this manipulation, you will probably have to use something like javascript for this.

I am concerned about JS/callout performance overhead as the document will be of 5 MB size. is there any sample JS to extract the attachment i can refer?

You could probably use something from this fiddle plus the json part and do a bit of testing.

I agree that you could have performance issues encoding / decoding data of this size.