axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r488677 - in /webservices/axis2/branches/java/1_1: maven.xml modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java modules/saaj/test/org/apache/axis2/saaj/PrefixesTest.java
Date Tue, 19 Dec 2006 13:56:53 GMT
Author: ruchithf
Date: Tue Dec 19 05:56:52 2006
New Revision: 488677

URL: http://svn.apache.org/viewvc?view=rev&rev=488677
Log:
fixed AXIS2-1874

Modified:
    webservices/axis2/branches/java/1_1/maven.xml
    webservices/axis2/branches/java/1_1/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
    webservices/axis2/branches/java/1_1/modules/saaj/test/org/apache/axis2/saaj/PrefixesTest.java

Modified: webservices/axis2/branches/java/1_1/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/maven.xml?view=diff&rev=488677&r1=488676&r2=488677
==============================================================================
--- webservices/axis2/branches/java/1_1/maven.xml (original)
+++ webservices/axis2/branches/java/1_1/maven.xml Tue Dec 19 05:56:52 2006
@@ -1174,7 +1174,6 @@
     <!-- ================================================================ -->
     <!--- Create Rampart Java Docs -->
     <!-- ================================================================ -->
-	aaf
     <goal name="rampart-javadocs">
         <ant:javadoc packagenames="org.apache.rampart.*, org.apache.rahas.*,org.apache.ws.secpolicy.*"
                      defaultexcludes="yes"

Modified: webservices/axis2/branches/java/1_1/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java?view=diff&rev=488677&r1=488676&r2=488677
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
Tue Dec 19 05:56:52 2006
@@ -172,8 +172,8 @@
             throw new SOAPException("Namespace not declared for the give prefix: " + prefix);
         }
         SOAPElementImpl childEle =
-                new SOAPElementImpl((ElementImpl) getOwnerDocument().createElementNS(namespaceURI,
-                                                                                     localName));
+                new SOAPElementImpl((ElementImpl) getOwnerDocument().
+                        createElementNS(namespaceURI, prefix + ":" + localName));
         childEle.element.setUserData(SAAJ_NODE, childEle, null);
         childEle.element.setNamespace(childEle.element.declareNamespace(namespaceURI, prefix));
         element.appendChild(childEle.element);

Modified: webservices/axis2/branches/java/1_1/modules/saaj/test/org/apache/axis2/saaj/PrefixesTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/saaj/test/org/apache/axis2/saaj/PrefixesTest.java?view=diff&rev=488677&r1=488676&r2=488677
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/saaj/test/org/apache/axis2/saaj/PrefixesTest.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/saaj/test/org/apache/axis2/saaj/PrefixesTest.java
Tue Dec 19 05:56:52 2006
@@ -23,6 +23,7 @@
 import javax.xml.soap.SOAPBody;
 import javax.xml.soap.SOAPElement;
 import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPHeader;
 import javax.xml.soap.SOAPMessage;
 import javax.xml.soap.SOAPPart;
 import javax.xml.soap.Text;
@@ -101,6 +102,37 @@
                 if (childElementIter == null) return;
                 validateBody(childElementIter);
             }
+        }
+    }
+
+    public void testAttrPrifix() {
+        try {
+            MessageFactory fac = MessageFactory.newInstance();
+
+            SOAPMessage msg = fac.createMessage();
+            SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
+            SOAPHeader header = msg.getSOAPHeader();
+            
+            Name name = env.createName("Local","pre1", "http://test1");
+            SOAPElement local = header.addChildElement(name);
+
+            Name name2 = env.createName("Local1","pre1", "http://test1");
+            SOAPElement local2 = local.addChildElement(name2);
+
+            Name aName = env.createName("attrib","pre1", "http://test1");
+            local2.addAttribute(aName, "value");
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            msg.writeTo(baos);
+            
+            String xml = new String(baos.toByteArray());
+            
+            assertTrue(xml.indexOf("xmlns:http://test1") == -1);
+            assertTrue(xml.indexOf("pre1:attrib=\"value\"") > 0);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail(e.getMessage());
         }
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message