1

I'm trying to send a soap request with a pdf attachment using karate framework.

I've got the same process on SoapUI working, but when I try to do it on karate, the attachment is not sending I've got the same process on SoapUI working, but when I try to do it on karate, the attachment is not sending (https://i.stack.imgur.com/WoiF6.png)

Could someone help me with that?

I've tried using multipart file with content-disposition attachment as follow, but its not working

  • And multipart file myfile = { read : '1.pdf', Content-ID:<2.pdf>, Content-Transfer-Encoding:binary, Content-Type: 'application/pdf', Content-Disposition: attachment; name: '1.pdf' }

  • And multipart file image = { read: '1.pdf', Content-Type: 'application/pdf'}

  • And multipart file myFile = { read: '1.pdf', filename: '1.pdf' }

  • And multipart entity read('1.txt')

olikster
  • 11
  • 1

1 Answers1

0

The way karate works, if you know how to encode anything into a plain-text message (JSON / XML) it works.

I am not that familiar with the SOAP attachment spec - but there are 2 possibilities - one that you just need to Base64 encode the binary file into a string which is part of the SOAP payload body. Something like this: https://stackoverflow.com/a/52541026/143475

Or you can build a POST request with multi-part like you have been doing.

This is an area where it would be great if you or your team can research and contribute code or documentation / research.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248