javax.xml.soap.write-xml-declaration ignored in JBoss EAP

Solution Verified - Updated -

Issue

  • We set the system property javax.xml.soap.write-xml-declaration but EAP ignores it. No prolog is included in the response. How do I force the xml prolog on EAP ?

  • We are setting the property like the below code,

public boolean handleMessage(SOAPMessageContext soapMessageContext) 
        { 
                Boolean outboundProperty = (Boolean) soapMessageContext 
                        .get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); 

                SOAPMessage message = soapMessageContext.getMessage(); 
                if (outboundProperty.booleanValue()) 
                { 
                        try 
                        { 
                                message.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true"); 
                                soapMessageContext.setMessage(message); 
                                soapMessageContext.getMessage().writeTo(System.out); 
                        } 

                        catch (Exception e) 
                        { 

                        } 
                } 
                return true; 
        } 

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
  • Apache CXF

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.