[1/2] cxf git commit: [CXF-6867] Ensure Envelope and Body element prefixes are not changed when processing messages without headers

2016-04-14 Thread asoldano
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes f01d17173 -> 727e403f7


[CXF-6867] Ensure Envelope and Body element prefixes are not changed when 
processing messages without headers


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

Branch: refs/heads/3.0.x-fixes
Commit: 93c84a176cb94d0491971a7a394f61fad945d6fe
Parents: f01d171
Author: Alessio Soldano 
Authored: Wed Apr 13 23:02:56 2016 +0200
Committer: Alessio Soldano 
Committed: Thu Apr 14 11:49:13 2016 +0200

--
 .../interceptor/ReadHeadersInterceptor.java | 21 
 .../binding/soap/saaj/SAAJInInterceptor.java| 10 ++
 .../cxf/binding/soap/saaj/SAAJStreamWriter.java | 17 ++--
 .../apache/cxf/binding/soap/saaj/SAAJUtils.java | 17 
 4 files changed, 50 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/93c84a17/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
--
diff --git 
a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
 
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
index 88709a1..7b18d1c 100644
--- 
a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
+++ 
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
@@ -70,6 +70,8 @@ public class ReadHeadersInterceptor extends 
AbstractSoapInterceptor {
 
 public static final String ENVELOPE_EVENTS = "envelope.events";
 public static final String BODY_EVENTS = "body.events";
+public static final String ENVELOPE_PREFIX = "envelope.prefix";
+public static final String BODY_PREFIX = "body.prefix";
 /**
  * 
  */
@@ -205,6 +207,8 @@ public class ReadHeadersInterceptor extends 
AbstractSoapInterceptor {
 } else {
 message.put(ENVELOPE_EVENTS, 
processor.getEnvAttributeAndNamespaceEvents());
 message.put(BODY_EVENTS, 
processor.getBodyAttributeAndNamespaceEvents());
+message.put(ENVELOPE_PREFIX, 
processor.getEnvelopePrefix());
+message.put(BODY_PREFIX, processor.getBodyPrefix());
 }
 if (addNC) {
 // add the Body-level declarations
@@ -326,6 +330,8 @@ public class ReadHeadersInterceptor extends 
AbstractSoapInterceptor {
 private Document doc;
 private Node parent;
 private QName lastStartElementQName;
+private String envelopePrefix;
+private String bodyPrefix;
 
 public HeadersProcessor(SoapVersion version) {
 this.header = version.getHeader().getLocalPart();
@@ -409,6 +415,13 @@ public class ReadHeadersInterceptor extends 
AbstractSoapInterceptor {
 throw new Fault(e);
 }
 } else {
+if (ns.equals(lastStartElementQName.getNamespaceURI())) {
+if (body.equals(lastStartElementQName.getLocalPart())) 
{
+bodyPrefix = lastStartElementQName.getPrefix();
+} else if 
(envelope.equals(lastStartElementQName.getLocalPart())) {
+envelopePrefix = lastStartElementQName.getPrefix();
+}
+}
 events.add(event);
 }
 } else {
@@ -445,5 +458,13 @@ public class ReadHeadersInterceptor extends 
AbstractSoapInterceptor {
 return Collections.unmodifiableList(envEvents);
 }
 }
+
+public String getEnvelopePrefix() {
+return envelopePrefix;
+}
+
+public String getBodyPrefix() {
+return bodyPrefix;
+}
 }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/93c84a17/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
--
diff --git 
a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
 
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
index 1f12f8f..37b88c5 100644
--- 
a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
+++ 
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
@@ -193,6 +193,10 @@ publ

[1/2] cxf git commit: [CXF-6867] Ensure Envelope and Body element prefixes are not changed when processing messages without headers

2016-04-13 Thread asoldano
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 4a749e745 -> c7234f413


[CXF-6867] Ensure Envelope and Body element prefixes are not changed when 
processing messages without headers


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

Branch: refs/heads/3.1.x-fixes
Commit: bbc3ca287cca8cf982b62fb85c6a2bbc5bb59754
Parents: 4a749e7
Author: Alessio Soldano 
Authored: Wed Apr 13 23:02:56 2016 +0200
Committer: Alessio Soldano 
Committed: Wed Apr 13 23:08:53 2016 +0200

--
 .../interceptor/ReadHeadersInterceptor.java | 21 
 .../binding/soap/saaj/SAAJInInterceptor.java| 10 ++
 .../cxf/binding/soap/saaj/SAAJStreamWriter.java | 17 ++--
 .../apache/cxf/binding/soap/saaj/SAAJUtils.java | 17 
 4 files changed, 50 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/bbc3ca28/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
--
diff --git 
a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
 
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
index 269ef4d..6bfa3a3 100644
--- 
a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
+++ 
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
@@ -70,6 +70,8 @@ public class ReadHeadersInterceptor extends 
AbstractSoapInterceptor {
 
 public static final String ENVELOPE_EVENTS = "envelope.events";
 public static final String BODY_EVENTS = "body.events";
+public static final String ENVELOPE_PREFIX = "envelope.prefix";
+public static final String BODY_PREFIX = "body.prefix";
 /**
  * 
  */
@@ -205,6 +207,8 @@ public class ReadHeadersInterceptor extends 
AbstractSoapInterceptor {
 } else {
 message.put(ENVELOPE_EVENTS, 
processor.getEnvAttributeAndNamespaceEvents());
 message.put(BODY_EVENTS, 
processor.getBodyAttributeAndNamespaceEvents());
+message.put(ENVELOPE_PREFIX, 
processor.getEnvelopePrefix());
+message.put(BODY_PREFIX, processor.getBodyPrefix());
 }
 if (addNC) {
 // add the Body-level declarations
@@ -326,6 +330,8 @@ public class ReadHeadersInterceptor extends 
AbstractSoapInterceptor {
 private Document doc;
 private Node parent;
 private QName lastStartElementQName;
+private String envelopePrefix;
+private String bodyPrefix;
 
 HeadersProcessor(SoapVersion version) {
 this.header = version.getHeader().getLocalPart();
@@ -409,6 +415,13 @@ public class ReadHeadersInterceptor extends 
AbstractSoapInterceptor {
 throw new Fault(e);
 }
 } else {
+if (ns.equals(lastStartElementQName.getNamespaceURI())) {
+if (body.equals(lastStartElementQName.getLocalPart())) 
{
+bodyPrefix = lastStartElementQName.getPrefix();
+} else if 
(envelope.equals(lastStartElementQName.getLocalPart())) {
+envelopePrefix = lastStartElementQName.getPrefix();
+}
+}
 events.add(event);
 }
 } else {
@@ -445,5 +458,13 @@ public class ReadHeadersInterceptor extends 
AbstractSoapInterceptor {
 return Collections.unmodifiableList(envEvents);
 }
 }
+
+public String getEnvelopePrefix() {
+return envelopePrefix;
+}
+
+public String getBodyPrefix() {
+return bodyPrefix;
+}
 }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/bbc3ca28/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
--
diff --git 
a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
 
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
index 51afbf5..516bf89 100644
--- 
a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
+++ 
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
@@ -193,6 +193,10 @@ public clas