title: Axis2 with MTOM: Unexpected end of stream while reading a SOAP fault
body: <p>I'm trying to read a soap fault from an axis2 client, with mtom enabled.
  Axis2 version is 1.6.2, both for client and server.</p>
  
  <p>The wsdl part related to the fault:</p>
  
  <pre><code> .....
  
   &lt;xs:simpleType name="CodiceErroreDiTrasferimentoType"&gt;
              &lt;xs:annotation&gt;
                  &lt;xs:documentation&gt;Codici di errore generati durante il trasferimento del pacchetto di versamento&lt;/xs:documentation&gt;
              &lt;/xs:annotation&gt;
              &lt;xs:restriction base="xs:NMTOKEN"&gt;
                  &lt;xs:enumeration value="ERRORE_DI_SISTEMA"/&gt;
                  ...
              &lt;/xs:restriction&gt;
          &lt;/xs:simpleType&gt;
  ....
  
  &lt;xs:element name="ErroreDiTrasferimento"&gt;
              &lt;xs:annotation&gt;
                  &lt;xs:documentation&gt;Errore generato nella fase di trasferimento del pacchetto&lt;/xs:documentation&gt;
              &lt;/xs:annotation&gt;
              &lt;xs:complexType&gt;
                  &lt;xs:complexContent&gt;
                      &lt;xs:restriction base="ingest:ErroreType"&gt;
                          &lt;xs:sequence&gt;
                              &lt;xs:element name="Codice" type="ingest:CodiceErroreDiTrasferimentoType"/&gt;
                              &lt;xs:element name="Messaggio" type="xs:string"/&gt;
                              &lt;xs:element name="Riferimento" type="xs:string" minOccurs="0"/&gt;
                          &lt;/xs:sequence&gt;
                      &lt;/xs:restriction&gt;
                  &lt;/xs:complexContent&gt;
              &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  ....
  
  &lt;wsdl:message name="IngestFault"&gt;
      &lt;wsdl:part name="fault" element="ingest:ErroreDiTrasferimento"/&gt;
  &lt;/wsdl:message&gt;
  
  ....
  
      &lt;wsdl:operation name="InviaPacchettoDiVersamento"&gt;
          &lt;wsdl:input message="tns:InviaPacchettoDiVersamentoRequest"/&gt;
          &lt;wsdl:output message="tns:InviaPacchettoDiVersamentoResponse"/&gt;
          &lt;wsdl:fault name="IngestFault" message="tns:IngestFault"/&gt;
      &lt;/wsdl:operation&gt;
  
  ....
  
      &lt;wsdl:operation name="InviaPacchettoDiVersamento"&gt;
          &lt;soap:operation soapAction="urn:InviaPacchettoDiVersamento"/&gt;
          &lt;wsdl:input&gt;
              &lt;soap:body use="literal"/&gt;
          &lt;/wsdl:input&gt;
          &lt;wsdl:output&gt;
              &lt;soap:body use="literal"/&gt;
          &lt;/wsdl:output&gt;
          &lt;wsdl:fault name="IngestFault"&gt;
              &lt;soap:fault name="IngestFault" use="literal"/&gt;
          &lt;/wsdl:fault&gt;
      &lt;/wsdl:operation&gt;
  </code></pre>
  
  <p>During the reading/parsing of the IngestFault this exception occurs:</p>
  
  <pre><code>org.apache.axis2.AxisFault: org.apache.axiom.ext.io.StreamCopyException: Error reading from source
  at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
  at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:123)
  at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
  at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
  at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
  at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
  at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
  at test.cin.conserva.versamento.service.TrasferimentoStub.inviaPacchettoCompresso(TrasferimentoStub.java:1076)
  at test.cin.conserva.ingest.TransferServiceTestCase.testScenarioErrore02(TransferServiceTestCase.java:188)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
  at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
  at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  Caused by: org.apache.axiom.om.OMException: org.apache.axiom.ext.io.StreamCopyException: Error reading from source
  at org.apache.axiom.attachments.PartContentFactory.createPartContent(PartContentFactory.java:153)
  at org.apache.axiom.attachments.PartImpl.fetch(PartImpl.java:176)
  at org.apache.axiom.attachments.PartImpl.getContent(PartImpl.java:149)
  at org.apache.axiom.attachments.PartImpl.getInputStream(PartImpl.java:224)
  at org.apache.axiom.attachments.PartDataSource.getInputStream(PartDataSource.java:44)
  at javax.activation.DataHandler.getInputStream(DataHandler.java:223)
  at org.apache.axiom.attachments.MIMEMessage.getRootPartInputStream(MIMEMessage.java:196)
  at org.apache.axiom.attachments.Attachments.getRootPartInputStream(Attachments.java:248)
  at org.apache.axiom.attachments.Attachments.getSOAPPartInputStream(Attachments.java:224)
  at org.apache.axis2.builder.MIMEBuilder.processDocument(MIMEBuilder.java:78)
  at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:179)
  at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)
  at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:108)
  ... 31 more
   Caused by: org.apache.axiom.ext.io.StreamCopyException: Error reading from source
  at org.apache.axiom.attachments.utils.BAAOutputStream.readFrom(BAAOutputStream.java:114)
  at org.apache.axiom.attachments.impl.BufferUtils.inputStream2OutputStream(BufferUtils.java:76)
  at org.apache.axiom.attachments.PartContentFactory.createPartContent(PartContentFactory.java:119)
  ... 43 more
  Caused by: org.apache.james.mime4j.MimeIOException: Unexpected end of stream
  at org.apache.james.mime4j.io.MimeBoundaryInputStream.verifyEndOfStream(MimeBoundaryInputStream.java:205)
  at org.apache.james.mime4j.io.MimeBoundaryInputStream.readAllowed(MimeBoundaryInputStream.java:129)
  at org.apache.james.mime4j.io.MimeBoundaryInputStream.read(MimeBoundaryInputStream.java:152)
  at org.apache.james.mime4j.io.BufferedLineReaderInputStream.fillBuffer(BufferedLineReaderInputStream.java:111)
  at org.apache.james.mime4j.io.BufferedLineReaderInputStream.read(BufferedLineReaderInputStream.java:158)
  at org.apache.james.mime4j.io.LineReaderInputStreamAdaptor.read(LineReaderInputStreamAdaptor.java:67)
  at org.apache.axiom.attachments.utils.BAAOutputStream.readFrom(BAAOutputStream.java:112)
  ... 45 more
  Caused by: org.apache.james.mime4j.MimeException: Unexpected end of stream
  ... 52 more
  </code></pre>
  
  <p>The client can successfully read soap message other than soap faults.</p>
  
  <p>Any suggestion?
  Thanks.</p>