Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 051fea95e -> fa881b53c


Write the prolog only if it hasn't already been written
This closes #10


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e0d4f15f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e0d4f15f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e0d4f15f

Branch: refs/heads/2.7.x-fixes
Commit: e0d4f15fd6f1b4352c189442e5f2902303bcd5cb
Parents: 051fea9
Author: Daniel Kulp <[email protected]>
Authored: Wed Nov 26 10:51:25 2014 -0500
Committer: Daniel Kulp <[email protected]>
Committed: Wed Nov 26 14:42:47 2014 -0500

----------------------------------------------------------------------
 .../java/org/apache/cxf/frontend/WSDLGetOutInterceptor.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e0d4f15f/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetOutInterceptor.java
----------------------------------------------------------------------
diff --git 
a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetOutInterceptor.java
 
b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetOutInterceptor.java
index 196981d..07f835f 100644
--- 
a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetOutInterceptor.java
+++ 
b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetOutInterceptor.java
@@ -27,6 +27,7 @@ import org.w3c.dom.Document;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.StaxOutInterceptor;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.staxutils.StaxUtils;
@@ -52,7 +53,10 @@ public class WSDLGetOutInterceptor extends 
AbstractPhaseInterceptor<Message> {
         }
         message.put(Message.CONTENT_TYPE, "text/xml");
         try {
-            StaxUtils.writeNode(doc, writer, true);
+            StaxUtils.writeDocument(doc, writer, true,
+                                    
!MessageUtils.getContextualBoolean(message, 
+                                                                       
StaxOutInterceptor.FORCE_START_DOCUMENT, 
+                                                                       false));
         } catch (XMLStreamException e) {
             throw new Fault(e);
         }

Reply via email to