servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1185491 - in /servicemix/components/trunk/bindings/servicemix-cxf-bc/src: main/java/org/apache/servicemix/cxfbc/interceptors/StaxJbiWrapper.java test/resources/HelloWorld-DOC-Input-extra-namespace.xml
Date Tue, 18 Oct 2011 05:54:00 GMT
Author: ffang
Date: Tue Oct 18 05:53:59 2011
New Revision: 1185491

URL: http://svn.apache.org/viewvc?rev=1185491&view=rev
Log:
[SMXCOMP-910]NPE Generated whenever a soap message is received that contains a namespace prefix
but no namespace uri.

Modified:
    servicemix/components/trunk/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/StaxJbiWrapper.java
    servicemix/components/trunk/bindings/servicemix-cxf-bc/src/test/resources/HelloWorld-DOC-Input-extra-namespace.xml

Modified: servicemix/components/trunk/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/StaxJbiWrapper.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/StaxJbiWrapper.java?rev=1185491&r1=1185490&r2=1185491&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/StaxJbiWrapper.java
(original)
+++ servicemix/components/trunk/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/StaxJbiWrapper.java
Tue Oct 18 05:53:59 2011
@@ -515,12 +515,13 @@ public class StaxJbiWrapper implements X
 
     public String getNamespacePrefix(int i) {
         String prefix = parts.get(part).get(reader).getNamespacePrefix(i);
-        if (prefix != null && prefix.length() == 0 
-                && parts.get(part).get(reader).getNamespaceURI().length() > 0)
{
-            return CxfJbiConstants.WSDL11_WRAPPER_PART_LOCALNAME;
-        } else {
-            return prefix;
+        if (prefix != null && prefix.length() == 0) {
+            String uri = parts.get(part).get(reader).getNamespaceURI();
+            if (uri != null && uri.length() > 0) {
+                return CxfJbiConstants.WSDL11_WRAPPER_PART_LOCALNAME;
+            }
         }
+        return prefix;
     }
 
     public String getNamespaceURI(int i) {

Modified: servicemix/components/trunk/bindings/servicemix-cxf-bc/src/test/resources/HelloWorld-DOC-Input-extra-namespace.xml
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-cxf-bc/src/test/resources/HelloWorld-DOC-Input-extra-namespace.xml?rev=1185491&r1=1185490&r2=1185491&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-cxf-bc/src/test/resources/HelloWorld-DOC-Input-extra-namespace.xml
(original)
+++ servicemix/components/trunk/bindings/servicemix-cxf-bc/src/test/resources/HelloWorld-DOC-Input-extra-namespace.xml
Tue Oct 18 05:53:59 2011
@@ -18,4 +18,4 @@
 
 -->
 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="uri:HelloWorld"><soap:Body><ns2:SayHiRequest><text>hello</text></ns2:SayHiRequest></soap:Body></soap:Envelope>
+xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="uri:HelloWorld"><soap:Body><ns2:SayHiRequest><text
xmlns="" xmlns:q1="*">q1:hello</text></ns2:SayHiRequest></soap:Body></soap:Envelope>



Mime
View raw message