title: Axis2 receive MTOM attachment no datahandler found error
body: <p>For a project I'm implementing a SOAP service using Apache Axis2 1.6.2. I have a service which needs to receive a file using MTOM. But sadly I keep having issues with receiving a MTOM attached file. I keep getting the exception: </p>
  
  <pre><code>org.apache.axiom.om.OMException: A data handler was not found for content id cid:491414508823
  </code></pre>
  
  <p>....    </p>
  
  <p>I've tried to search the web for an answer, but was not succesful. I hope someone can get me in the right direction. My wsdl contains the following snippet:</p>
  
  <pre><code>...
  &lt;xs:element minOccurs="0" name="PDF_Attachment"&gt;
    &lt;xs:complexType&gt;
       &lt;xs:all&gt;
           &lt;xs:element minOccurs="0" name="PDF_AttachmentName" type="xs:string"/&gt;
           &lt;xs:element name="PDF_AttachmentContent" type="xs:base64Binary"/&gt;
       &lt;/xs:all&gt;
     &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  ...
  </code></pre>
  
  <p>I use SoapUI to generate the request and have set the property 'use MTOM' to true.</p>
  
  <p>Is there anyone who has encountered the same problem or knows how to solve this. Help would be greatly appreciated!</p>
  
  <p>Richard</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I think I've tackled the problem. The issue was within my xsd/wsdl definitions. I used jaxb to convert my business objects defined in external xsd's to POJO with JAXB annotations. But the xs:base64Binary was converted as byte[]. Changing the xsd with:</p>
  
  <pre><code>&lt;xs:schema ... xmlns:xmime="http://www.w3.org/2005/05/xmlmime"&gt; ...
  </code></pre>
  
  <p>And changing the element to: </p>
  
  <pre><code>&lt;xs:element name="PDF_AttachmentContent" minOccurs="1" maxOccurs="1" type="xs:base64Binary" xmime:expectedContentTypes="application/octet-stream"&gt;
  </code></pre>
  
  <p>JAXB now created a DataHandler as return type in the getPDF_AttatchmentContent. The only issue I have to tackle is to allow SOAPUI to send the MTOM attachments. Somehow A testclient I've created works perfectly, but SOAPUI does not send the attachment... </p>
  
  <p>Source for the solution above: <a href="http://cxf.apache.org/docs/mtom-attachments-with-jaxb.html" rel="nofollow">http://cxf.apache.org/docs/mtom-attachments-with-jaxb.html</a></p>
  
  <p>UPDATE 2:
  <a href="http://ssagara.blogspot.nl/2012/03/test-axis2-jax-ws-mtom-service-using.html" rel="nofollow">http://ssagara.blogspot.nl/2012/03/test-axis2-jax-ws-mtom-service-using.html</a> solved my SOAPUI issues with MTOM. I did not edit the correct cid in my soap message. I assumed that SOAPUI would assist me with that, but it didn't.</p>