How to send MTOM attachments in a consumed web service?

According to the release notes, Mendix 5.14+ should be able to send attachments via MTOM. But how? I tried by creating a consumed web service based on wsdl that we received from the other party. But I do not see an option to send an attachment as MTOM. Mendix adds the file data inline in the request xml: <ns1:document>MjAxNC0.......</ns1:document> But in the desired request xml there should be a reference instead of the file data (and the actual data should be provided in a mime section outside the xml): <mtom:document><inc:Include href="cid:915251933163" xmlns:inc=""/></mtom:document> How to achieve this? Does anybody have experience with this? Note that I have also filed a ticket for requesting this information (368693) but I put the question here anyway because of the bigger audience.
1 answers

Solution found thanks to Johan Flikweert and Jibbe Oomes. It turns out that we received a wrong wsdl file.

The (xsd part of the) wsdl should contain:

<xsd:element name="document" type="xsd:base64Binary" xmime:expectedContentTypes="application/octet-stream"/>


<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="" elementFormDefault="qualified" xmlns:xsd="" xmlns="">
  <xsd:element name="mtomRequest" type="MtomRequestType"/>
  <xsd:complexType name="MtomRequestType">
      <xsd:element name="document" type="xsd:base64Binary" xmime:expectedContentTypes="application/octet-stream"/>
  <xsd:element name="mtomResponse" type="MtomResponseType"/>
  <xsd:complexType name="MtomResponseType">
      <xsd:element name="document" type="xsd:string"/>

The outgoing XML (from Mendix) will then contain something like:

<ns1:document xmime:contentType="application/octet-stream" xmlns:xmime="">
    <xop:Include href="cid:78b05872-79a1-459a-a389-b42a7e5898a6" xmlns:xop=""/>

Note that the text xmime:contentType="application/octet-stream" xmlns:xmime="" is currently always included even if it's not specified in the wsdl (fix requested, ticket 374869, 463291, 463341).