<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
MTOM interop issue with WCF
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/gllambi">Guzman LlambiÂas</a> in <i>JBoss Web Services</i> - <a href="http://community.jboss.org/message/560476#560476">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I have a WCF client that wants to consume a JBossWS (Native) Service with MTOM, but when I run the client the following error occurs:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>Root MIME part must contain non-zero length value for 'charset' parameter in Content-Type header.</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>According to [1] this error occurs because the WCF client is expecting to receive the <em>charset</em> in the root MIME Content-Type header. The response message is this:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
Content-Type: multipart/related; type="application/xop+xml"; start="&lt;rootpart@ws.jboss.org&gt;";start-info="text/xml";boundary="----=_Part_3_27962205.1283538375093"
Date: Fri, 03 Sep 2010 18:26:15 GMT
Content-Length: 3982344
-
=_Part_3_27962205.1283538375093
Content-Type: application/xop+xml; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID:
-
=_Part_3_27962205.1283538375093
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Id: &lt;content-dcab441-3b16-4348-863f-31585ce7bda0@ws.jboss.org&gt;
Binary content
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">HTTP/1.1 200 OK</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Server: Apache-Coyote/1.1</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>Content-Type: multipart/related; type="application/xop+xml"; start="<</span><a class="jive-link-email-small" href="mailto:rootpart@ws.jboss.org" target="_blank">rootpart@ws.jboss.org</a><span>>";        start-info="text/xml";        boundary="----=_Part_3_27962205.1283538375093"</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Date: Fri, 03 Sep 2010 18:26:15 GMT</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Content-Length: 3982344</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> </div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> </div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">------=_Part_3_27962205.1283538375093</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Content-Type: application/xop+xml; type="text/xml"</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Content-Transfer-Encoding: 8bit</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>Content-ID: <</span><a class="jive-link-email-small" href="mailto:rootpart@ws.jboss.org" target="_blank">rootpart@ws.jboss.org</a><span>></span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> </div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span><env:Envelope xmlns:env='</span><a class="jive-link-external-small" href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank">http://schemas.xmlsoap.org/soap/envelope/</a><span>'><env:Header></env:Header><env:Body><ns2:getFileResponse xmlns:ns2="</span><a class="jive-link-external-small" href="http://sample/" target="_blank">http://sample/</a><span>"><return><content><xop:Include xmlns:xop="</span><a class="jive-link-external-small" href="http://www.w3.org/2004/08/xop/include" target="_blank">http://www.w3.org/2004/08/xop/include</a><span>" href="cid:</span><a class="jive-link-email-small" href="mailto:content-dcab441-3b16-4348-863f-31585ce7bda0@ws.jboss.org" target="_blank">content-dcab441-3b16-4348-863f-31585ce7bda0@ws.jboss.org</a><span>"/></content><date>2010-09-03T14:26:15.078-04:00</date><id>ID-12345</id></return></ns2:getFileResponse></env:Body></env:Envelope></span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">------=_Part_3_27962205.1283538375093</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Content-Type: application/octet-stream</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Content-Transfer-Encoding: binary</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>Content-Id: <</span><a class="jive-link-email-small" href="mailto:content-dcab441-3b16-4348-863f-31585ce7bda0@ws.jboss.org" target="_blank">content-dcab441-3b16-4348-863f-31585ce7bda0@ws.jboss.org</a><span>></span></div><p>If you look carefully, the MIME Root doesn't have the charset in the Content-Type header.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Looking at [2], .NET says "<span style="color: #000000; font-family: 'Segoe UI', Verdana, Arial;"><em>While XOP defines the </em><strong><em>charset</em></strong><em> parameter for </em><strong><em>application/xop+xml</em></strong><em> to be optional, it is needed for interoperability similar to the BP 1.1 requirement on the </em><strong><em>charset</em></strong><em> parameter for the </em><strong><em>text/xml</em></strong><em> media type.</em></span>"</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The BP 1.2 has a recommendation related to this:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><em><span style="font-size: 10pt;"><span style="font-style: normal;">R1018 </span><strong>A </strong></span><span style="font-style: normal; font-size: 10pt; font-weight: bold; "><strong>SIMPLE_SOAP_MESSAGE</strong></span><span style="font-size: 10pt;"><strong> MUST indicate the correct character encoding, using the "charset" parameter. </strong></span></em></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #000000;">The following message works correctly and has the charset defined in the Content-Type header:</span></p><p><span style="color: #000000;"><br/></span></p><pre class="jive-pre"><code class="jive-code">
HTTP/1.1 200 OK
Content-Length: 3407478
Content-Type: multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:774aed72-9fbd-43ba-a09a-24a5a025899e+id=2";start-info="text/xml"
Server: Microsoft-HTTPAPI/1.0
MIME-Version: 1.0
Date: Fri, 03 Sep 2010 18:33:41 GMT
--uuid:774aed72-9fbd-43ba-a09a-24a5a025899e+id=2
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><GetDataResponse xmlns="http://tempuri.org/"><GetDataResult><xop:Include href="cid:http%3A%2F%2Ftempuri.org%2F1%2F634191248212968750" xmlns:xop="http://www.w3.org/2004/08/xop/include"/></GetDataResult></GetDataResponse></s:Body></s:Envelope>
--uuid:774aed72-9fbd-43ba-a09a-24a5a025899e+id=2
Content-ID: <http://tempuri.org/1/634191248212968750>
Content-Transfer-Encoding: binary
Content-Type: application/octet-stream
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>is there a way to set the charset on the jboss response?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks in advance!</p><p>Regards</p><p>Guzmán</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>[1] <a class="jive-link-external-small" href="http://blogs.msdn.com/b/distributedservices/archive/2010/01/06/manipulate-a-wcf-request-response-using-a-custom-encoder.aspx">http://blogs.msdn.com/b/distributedservices/archive/2010/01/06/manipulate-a-wcf-request-response-using-a-custom-encoder.aspx</a></p><p>[2] <a class="jive-link-external-small" href="http://msdn.microsoft.com/en-us/library/aa738574.aspx">http://msdn.microsoft.com/en-us/library/aa738574.aspx</a></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/560476#560476">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>