Send FileDocument contents to an imported webservice

3
I have imported a webservice that needs a binary parameter in the request body. I want to attach the binary contents of the FileDocument to the webservice call. Is it possible in the Modeler to transform a FileDocument to an binary type? Or is there another solution to send a FileDocument over webservice?
asked
3 answers
3

Yes, you can do this by mapping the Contents attribute (which has the Mendix type Binary) of your FileDocument object to an XML entity of type xsd:base64Binary (and vice versa).

It's just like any other mapping. You have an entity that you want to map to some xml. Only this xml has an attribute of type xsd:base64Binary. If we choose a FileDocument (or an entity that inherits from FileDocument) an extra attribute shows up in the mapping screen, namely Contents. Select this attribute for the xml element of type base64Binary and you're done. The contents of the FileDocument will be translated to that xml element.

answered
0

Could anyone tell me in details how can I do this mapping?

answered
0

I have a published WS which returns an object with a list of documents related to it

  1. I created an imported WS to call this published WS and get the object with the list of document.
  2. I created An XSD file with an element type xsd:base64Binary
  3. what are the steps in details to get those documents through the WS ?
answered