<!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;"> </p><p>I'm using Jboss 7.1.1final + ...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p>Here the extracts from the trace file:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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.<init> 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;"> </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;">    {</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;">        SOAPMessage message = soapCtx.getMessage();</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        SOAPHeader header;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        try {</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">            header = message.getSOAPPart().getEnvelope().getHeader();</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        } catch (SOAPException e) {</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">            throw new RuntimeException(e);</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        }</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">        Iterator<SOAPHeaderElement> it;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;">        if (header != null) {</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">            it = header.examineAllHeaderElements();</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">            while (it.hasNext()) {</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier; font-size: 8pt;">                SOAPHeaderElement element = it.next();</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">                String elementName = element.getLocalName();</span></p><p>                </p><p><span style="font-family: courier new,courier; font-size: 8pt;">                Node n = element.getFirstChild();</span></p><p>                </p><p><span style="font-family: courier new,courier; font-size: 8pt;">                String value = n.getTextContent();</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p style="text-align: start;">This code works perfectly in other Appserver...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="text-align: start;">Any idea??</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="text-align: start;">Thanks</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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]  target --> </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:[<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>"><soap:Header><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>">&lt;Assertion&gt;&#13;</span></span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890&#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;">&lt;Assertion&gt;&#13;</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;"><span></wsse:Security><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">urn:ihe:iti:2007:RegistryStoredQuery</wsa:Action><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"><wsa:Address></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></wsa:Address></wsa:ReplyTo><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>"></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></wsa:To><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>">7dd20f4c-c1f7-45cb-befc-c77b257d9df6</wsa:MessageID></soap:Header><soap:Body><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"><ns5:ResponseOption returnComposedObjects="true" returnType="LeafClass"/><AdhocQuery id="urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d"><Slot name="$XDSDocumentEntryPatientId"><ValueList><Value>NA5156^^^&amp;1.3.6.1.4.1.21367.2010.1.2.300&amp;ISO</Value></ValueList></Slot><Slot name="$XDSDocumentEntryStatus"><ValueList><Value>urn:oasis:names:tc:ebxml-regrep:StatusType:Approved</Value></ValueList></Slot></AdhocQuery></ns5:AdhocQueryRequest></soap:Body></soap:Envelope>]</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.<init> Constructor</span></p><p><span style="font-family: courier new,courier; font-size: 8pt;"><Assertion></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>