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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content