<!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="https://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;">
    Soap header truncated
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/daniel.cote.qc.ca">Daniel Cote</a> in <i>JBoss Web Services</i> - <a href="https://community.jboss.org/message/804261#804261">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;">&#160;</p><p>I'm using Jboss 7.1.1final + ...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In a WebService, I configured a SoapHandler that is use to extract information from the incoming transaction.</p><p>Altough it worked fine for usual use cases, it broked when I tried to extract soap header content that was bigger (more than 512 bytes).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here the extracts from the trace file:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Note the followings:</p><ul><li style="text-align: start;">the payload received (logged) demonstrates that the transaction is well received, including the complete content of the <span style="font-family: courier new,courier; font-size: 8pt;">wsse:Security </span>header (payload is here irrelevant, just a serie of 0123456789...)</li><li style="text-align: start;">the <span style="font-family: courier new,courier; font-size: 8pt;">07:27:34,792 CONF (http-localhost-127.0.0.1-8080-1) com.ibm.ihii.xua.AbstractSAMLValidator.&lt;init&gt; Constructor </span><br/>shows that the content, that has been extracted, is truncated ..</li><li style="text-align: start;">In debug, I can see that when processing the header, the content that is made available matches the truncated value... The problem is is the handler...</li><li style="text-align: start;">Here an extract from the extraction code used by the handler:</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier; font-size: 8pt;">static private void extractSoapHeader(SOAPMessageContext soapCtx, CallContext callContext)</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160; {</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; SOAPMessage message = soapCtx.getMessage();</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; SOAPHeader header;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; header = message.getSOAPPart().getEnvelope().getHeader();</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (SOAPException e) {</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; throw new RuntimeException(e);</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; Iterator&lt;SOAPHeaderElement&gt; it;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (header != null) {</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; it = header.examineAllHeaderElements();</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; while (it.hasNext()) {</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SOAPHeaderElement element = it.next();</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; String elementName = element.getLocalName();</span></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Node n = element.getFirstChild();</span></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p><span style="font-family: courier new,courier; font-size: 8pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; String value = n.getTextContent();</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">The 'value' variable matches the truncated value...</p><p style="text-align: start;">The <span style="font-family: courier new,courier; font-size: 8pt;">SOAPHeader implementation is </span>com.sun.xml.messaging.saaj.soap.ver1_2.Header1_2Impl during the execution.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">This code works perfectly in other Appserver...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">Any idea??</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">Thanks</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier; font-size: 8pt;"><span>07:27:34,573 INFO (http-localhost-127.0.0.1-8080-1) com.ibm.ai.xds.webContext.XDSHandler.Msg from: [ 127.0.0.1]&#160; target --&gt; </span><a class="jive-link-external-small" href="http://localhost:8080/XDSRegistryWS/DocumentRegistry_Service" rel="nofollow" target="_blank">http://localhost:8080/XDSRegistryWS/DocumentRegistry_Service</a><span> action:[urn:ihe:iti:2007:RegistryStoredQuery]</span></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;"><span>07:27:34,573 CONF (http-localhost-127.0.0.1-8080-1) com.ibm.ai.xds.webContext.XDSHandler.logMessage message received... payload:[&lt;soap:Envelope xmlns:soap="</span><a class="jive-link-external-small" href="http://www.w3.org/2003/05/soap-envelope" rel="nofollow" target="_blank">http://www.w3.org/2003/05/soap-envelope</a><span>"&gt;&lt;soap:Header&gt;&lt;wsse:Security xmlns:wsse="</span><a class="jive-link-external-small" href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0" rel="nofollow" target="_blank">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0</a><span>"&gt;&amp;lt;Assertion&amp;gt;&amp;#13;</span></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&amp;#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&amp;#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&amp;#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&amp;#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&amp;#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&amp;#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&amp;lt;Assertion&amp;gt;&amp;#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;"><span>&lt;/wsse:Security&gt;&lt;wsa:Action xmlns:wsa="</span><a class="jive-link-external-small" href="http://www.w3.org/2005/08/addressing" rel="nofollow" target="_blank">http://www.w3.org/2005/08/addressing</a><span>" soap:mustUnderstand="1"&gt;urn:ihe:iti:2007:RegistryStoredQuery&lt;/wsa:Action&gt;&lt;wsa:ReplyTo xmlns:wsa="</span><a class="jive-link-external-small" href="http://www.w3.org/2005/08/addressing" rel="nofollow" target="_blank">http://www.w3.org/2005/08/addressing</a><span>" soap:mustUnderstand="1"&gt;&lt;wsa:Address&gt;</span><a class="jive-link-external-small" href="http://www.w3.org/2005/08/addressing/anonymous" rel="nofollow" target="_blank">http://www.w3.org/2005/08/addressing/anonymous</a><span>&lt;/wsa:Address&gt;&lt;/wsa:ReplyTo&gt;&lt;wsa:To xmlns:wsa="</span><a class="jive-link-external-small" href="http://www.w3.org/2005/08/addressing" rel="nofollow" target="_blank">http://www.w3.org/2005/08/addressing</a><span>"&gt;</span><a class="jive-link-external-small" href="http://localhost:8080/XDSRegistryWS/DocumentRegistry_Service" rel="nofollow" target="_blank">http://localhost:8080/XDSRegistryWS/DocumentRegistry_Service</a><span>&lt;/wsa:To&gt;&lt;wsa:MessageID xmlns:wsa="</span><a class="jive-link-external-small" href="http://www.w3.org/2005/08/addressing" rel="nofollow" target="_blank">http://www.w3.org/2005/08/addressing</a><span>"&gt;7dd20f4c-c1f7-45cb-befc-c77b257d9df6&lt;/wsa:MessageID&gt;&lt;/soap:Header&gt;&lt;soap:Body&gt;&lt;ns5:AdhocQueryRequest xmlns="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" xmlns:ns4="urn:ihe:iti:xds-b:2007" xmlns:ns5="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0"&gt;&lt;ns5:ResponseOption returnComposedObjects="true" returnType="LeafClass"/&gt;&lt;AdhocQuery id="urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d"&gt;&lt;Slot name="$XDSDocumentEntryPatientId"&gt;&lt;ValueList&gt;&lt;Value&gt;NA5156^^^&amp;amp;1.3.6.1.4.1.21367.2010.1.2.300&amp;amp;ISO&lt;/Value&gt;&lt;/ValueList&gt;&lt;/Slot&gt;&lt;Slot name="$XDSDocumentEntryStatus"&gt;&lt;ValueList&gt;&lt;Value&gt;urn:oasis:names:tc:ebxml-regrep:StatusType:Approved&lt;/Value&gt;&lt;/ValueList&gt;&lt;/Slot&gt;&lt;/AdhocQuery&gt;&lt;/ns5:AdhocQueryRequest&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;]</span></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">07:27:34,604 WARN (http-localhost-127.0.0.1-8080-1) com.ai.utils.BaseParms.getInstance Instance [OrchestrationConfig.xml] has been updated... Launching refresh</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">07:27:34,620 INFO (http-localhost-127.0.0.1-8080-1) com.ibm.ai.xds.registry.webservices.DocumentRegistryImpl.constructor !</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">07:27:34,620 INFO (http-localhost-127.0.0.1-8080-1) com.ibm.ai.xds.registry.webservices.DocumentRegistryImpl.constructor !</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">07:27:34,620 INFO (http-localhost-127.0.0.1-8080-1) com.ibm.ai.xds.registry.submission.validation.ReferenceDataModel.constructor </span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">07:27:34,792 CONF (http-localhost-127.0.0.1-8080-1) com.ibm.ihii.xua.AbstractSAMLValidator.&lt;init&gt; Constructor</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&lt;Assertion&gt;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">07:27:34,807 ERRO (http-localhost-127.0.0.1-8080-1) stderr.write [Fatal Error] :6:80: XML document structures must start and end within the same entity.</span></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/804261#804261">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="https://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>