Author: jbonofre
Date: Thu Nov  5 18:38:32 2009
New Revision: 833116

URL: http://svn.apache.org/viewvc?rev=833116&view=rev
Log:
[SMXCOMP-656] Implement getNamespaceCount(), getNamespacePrefix(int i) and 
getNamespaceUri(int i) methods in the StaxJbiWrapper to be able to manage 
xmlns='' in StaxSource.

Modified:
    
servicemix/components/shared-libraries/trunk/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1Interceptor.java
    
servicemix/components/shared-libraries/trunk/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1InterceptorTest.java

Modified: 
servicemix/components/shared-libraries/trunk/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1Interceptor.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/shared-libraries/trunk/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1Interceptor.java?rev=833116&r1=833115&r2=833116&view=diff
==============================================================================
--- 
servicemix/components/shared-libraries/trunk/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1Interceptor.java
 (original)
+++ 
servicemix/components/shared-libraries/trunk/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1Interceptor.java
 Thu Nov  5 18:38:32 2009
@@ -545,15 +545,25 @@
         }
 
         public int getNamespaceCount() {
-            return 0;
+            switch (state) {
+            case STATE_START_ELEMENT_WRAPPER:
+            case STATE_END_ELEMENT_WRAPPER:
+            case STATE_START_ELEMENT_PART:
+            case STATE_END_ELEMENT_PART:
+                return 0;
+            case STATE_RUN_PART:
+                return parts.get(part).get(reader).getNamespaceCount();
+            default:
+                throw new IllegalStateException();
+        }
         }
 
         public String getNamespacePrefix(int i) {
-            throw new UnsupportedOperationException("Not implemented");
+            return parts.get(part).get(reader).getNamespacePrefix(i);
         }
 
         public String getNamespaceURI(int i) {
-            throw new UnsupportedOperationException("Not implemented");
+            return parts.get(part).get(reader).getNamespaceURI(i);
         }
 
         public NamespaceContext getNamespaceContext() {

Modified: 
servicemix/components/shared-libraries/trunk/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1InterceptorTest.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/shared-libraries/trunk/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1InterceptorTest.java?rev=833116&r1=833115&r2=833116&view=diff
==============================================================================
--- 
servicemix/components/shared-libraries/trunk/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1InterceptorTest.java
 (original)
+++ 
servicemix/components/shared-libraries/trunk/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1InterceptorTest.java
 Thu Nov  5 18:38:32 2009
@@ -113,7 +113,7 @@
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         DomUtil.getTransformerFactory().newTransformer().transform(new 
DOMSource(doc), new StreamResult(baos));
   
-        //assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><jbi:message 
xmlns:jbi=\"http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper\"; 
xmlns:msg=\"urn:test\" name=\"message\" type=\"msg:message\" 
version=\"1.0\"><jbi:part><echo xmlns=\"http://www.example.org\";><request 
xmlns=\"\"><message>hello</message></request></echo></jbi:part></jbi:message>", 
baos.toString());
+        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><jbi:message 
xmlns:jbi=\"http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper\"; 
xmlns:msg=\"urn:test\" name=\"message\" type=\"msg:message\" 
version=\"1.0\"><jbi:part><echo xmlns=\"http://www.example.org\";><request 
xmlns=\"\"><message>hello</message></request></echo></jbi:part></jbi:message>", 
baos.toString());
         log.info(baos.toString());
     }
     


Reply via email to