Forum Discussion

asamaj's avatar
13 years ago

Content-transfer-enconding for text/xml attachments

I'm testing a web service using a soapUI project that sends an WS-I swaRef attachment (an XML file). When I examine the SOAP request built by soapUI, the header information for MIME part containing the attached file (UTF-8 XML file) can be this:

------=_Part_2_15813854.1330681528190
Content-Type: text/xml; charset=Cp1252; name=XML1.xml
Content-Transfer-Encoding: quoted-printable
Content-ID: <801091963244>
Content-Disposition: attachment; name="XML1.xml"; filename="XML1.xml"

But, using another XML file (UTF-8 encoded XML file, also), the header is:

------=_Part_3_3516736.1330682171067
Content-Type: text/xml; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-ID: <801091963244>
Content-Disposition: attachment; name="XML2.xml"

So, what makes soapUI decide between "7bit" or "quoted-printable" value for "Content-Transfer-Encoding" property? Could I change this behavior?

(I'v uploaded both files to the forum)

Thanks.

1 Reply

  • wsalembi's avatar
    wsalembi
    Occasional Contributor
    SoapUI uses the mail api. The behavior is described here:
    http://docs.oracle.com/javaee/6/api/jav ... DataSource)

    If the primary type of this datasource is "text" and if all the bytes in its input stream are US-ASCII, then the encoding is "7bit". If more than half of the bytes are non-US-ASCII, then the encoding is "base64". If less than half of the bytes are non-US-ASCII, then the encoding is "quoted-printable".