/* */ public void writeHeaders(SOAPMessage message)
/* */ throws AddressingException
/* */ {
/* */ try
/* */ {
/* 214 */ SOAPFactoryImpl factory = (SOAPFactoryImpl)SOAPFactory.newInstance();
/* 215 */ SOAPHeader soapHeader = message.getSOAPHeader();
/* */
/* 218 */ soapHeader.addNamespaceDeclaration(ADDR.getNamespacePrefix(), ADDR.getNamespaceURI());
/* */
/* 221 */ if (getTo() != null)
/* */ {
/* 223 */ SOAPElement element = soapHeader.addChildElement(new NameImpl(ADDR.getToQName()));
/* 224 */ element.addTextNode(getTo().getURI().toString());
/* */ }
/* */
/* 228 */ if (getFrom() != null)
/* */ {
/* 230 */ EndpointReferenceImpl epr = (EndpointReferenceImpl)getFrom();
/* 231 */ epr.setRootQName(ADDR.getFromQName());
/* 232 */ SOAPElement soapElement = factory.createElement(epr.toElement());
/* 233 */ soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
/* 234 */ soapHeader.addChildElement(soapElement);
/* */ }
/* */
/* 238 */ if (getReplyTo() != null)
/* */ {
/* 240 */ EndpointReferenceImpl epr = (EndpointReferenceImpl)getReplyTo();
/* 241 */ epr.setRootQName(ADDR.getReplyToQName());
/* 242 */ SOAPElement soapElement = factory.createElement(epr.toElement());
/* 243 */ soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
/* 244 */ soapHeader.addChildElement(soapElement);
/* */ }
/* */
/* 248 */ if (getFaultTo() != null)
/* */ {
/* 250 */ EndpointReferenceImpl epr = (EndpointReferenceImpl)getFaultTo();
/* 251 */ epr.setRootQName(ADDR.getFaultToQName());
/* 252 */ SOAPElement soapElement = factory.createElement(epr.toElement());
/* 253 */ soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
/* 254 */ soapHeader.addChildElement(soapElement);
/* */ }
/* */
/* 257 */ appendRequiredHeader(soapHeader, ADDR.getActionQName(), getAction());