MTOM and 7bit encoding attachment not fully read when attachment cache is 
enabled
---------------------------------------------------------------------------------

                 Key: AXIOM-413
                 URL: https://issues.apache.org/jira/browse/AXIOM-413
             Project: Axiom
          Issue Type: Bug
            Reporter: Gergan Dimitrov


Hi,

I have a MTOM message where the part containing the attachment is with content 
type text/plain and the content transfer encoding is 7bit. My Skeleton is 
storing the content of the attachment in a file:

 try {
     DataHandler dh = sendClaim.getData();
     File outFile = new File("g:/stored_axis2.txt");
     FileOutputStream fileOutputStream = new FileOutputStream(outFile);
     dh.writeTo(fileOutputStream);
     fileOutputStream.close();
} catch (Exception e) {}

File cache is enabled, with very small threshold size:

    <parameter name="cacheAttachments">true</parameter>
    <parameter name="attachmentDIR">G:\ant</parameter>
    <parameter name="sizeThreshold">1</parameter>

The request looks like this:

POST http://localhost:8080/axis2/services/ClaimService HTTP/1.1
Accept-Encoding: gzip,deflate
SOAPAction: "http://example.com/soapaction";
Content-Type: multipart/related; type="application/xop+xml"; 
start="<[email protected]>"; start-info="text/xml"; 
boundary="----=_Part_7_31148936.1331293159184"
MIME-Version: 1.0
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:8080
Content-Length: 999


------=_Part_7_31148936.1331293159184
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <[email protected]>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:wsdl="http://example.com/wsdl";>
   <soapenv:Header/>
   <soapenv:Body>
      <wsdl:SendClaim>
         <data><inc:Include href="cid:973197553864" 
xmlns:inc="http://www.w3.org/2004/08/xop/include"/></data>
      </wsdl:SendClaim>
   </soapenv:Body>
</soapenv:Envelope>
------=_Part_7_31148936.1331293159184
Content-Type: text/plain; charset=us-ascii; name=rand_text.txt
Content-Transfer-Encoding: 7bit
Content-ID: <973197553864>
Content-Disposition: attachment; name="rand_text.txt"; filename="rand_text.txt"

Some random text Some random text Some random text
------=_Part_7_31148936.1331293159184--

In the resulting file, I have only this:

S

If I disable the attachment cache, I get the full text in the attachment. So 
this issue seems to be related to this cache.

Any help would be appreciated.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to