public void updateSoapFaultHeaders(final SoapFault soapFault)
{
final List soapFaultHeaders = new ArrayList() ;
if (to != null)
{
soapFaultHeaders.add(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_TO, to)) ;
}
if (action != null)
{
soapFaultHeaders.add(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_ACTION, action)) ;
}
if (messageID != null)
{
soapFaultHeaders.add(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_MESSAGE_ID, messageID)) ;
}
if (from != null)
{
soapFaultHeaders.add(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FROM, from)) ;
}
if (replyTo != null)
{
soapFaultHeaders.add(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_REPLY_TO, replyTo)) ;
}
if (faultTo != null)
{
soapFaultHeaders.add(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_TO, faultTo)) ;
}
if (relatesTo != null)
{
final Iterator relatesToIter = relatesTo.iterator() ;
while(relatesToIter.hasNext())
{
final RelatesToType relationship = (RelatesToType)relatesToIter.next() ;
soapFaultHeaders.add(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_RELATES_TO, relationship)) ;
}
}
final NamedElement[] currentHeaders = ((SoapFault10)soapFault).getHeaderElements() ;
final int numHeaderElements = (currentHeaders == null ? 0 : currentHeaders.length) ;
for(int count = 0 ; count < numHeaderElements ; count++)