Hello Ronald,
have you set the contentType to the type you expeted (eg. json)?
I'm sorry repeating Gerrit; but did you really send the Content-Type header on the consuming side, like shown below? Postman / SoapUI will automatically add this header, that's why. And if so: could you show the Trace/Debug-logs of the consuming side to validate what is send is correct JSON?
[EDIT 17-06]
I agree with Michiel, exporting and importing to XML-type can be easily done in Mendix, both base64-encoded strings as the Contents of FileDocuments are accepted.
<xs:restriction base="xs:base64Binary">
In JSON, you are “stuck” with just a String and you have to Base64 encode/decode it yourself.
On the other hand, I always prefer non-persistent entities in all my integrations; so I never use persistent FileDocuments in my mappings and determine when the base64 encoding/decoding takes place.
You should be able to support mixed data including files using a Publish REST Service using form parameters. The screenshots demonstrate passing text, JSON text, and binary files in one request.
You can generate the request in Postman. See screenshot for configuration.
I recommend using the executable ngrok and the command ‘./ngrok http 8080’ to allow receiving POST requests while debugging the local project.
POST operation (no path) with 4 Form parameters. 2 Strings, 1 FileDocument, 1 specialization of FileDocument. Match Name values in Postman request and map MPReceive microflow parameters.
Postman POST request, Default headers, Body > form-data.
ReceiveMP microflow
I wouldn’t base64 encode the file. Just post it in binary format.
If you want to add metadata, I suggest to use HTTP headers.