axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r825943 - in /webservices/axis2/trunk/java/modules/jaxws: src/org/apache/axis2/jaxws/message/util/XMLFaultUtils.java test/org/apache/axis2/jaxws/misc/XMLFaultTest.java
Date Fri, 16 Oct 2009 15:33:12 GMT
Author: scheu
Date: Fri Oct 16 15:33:12 2009
New Revision: 825943

URL: http://svn.apache.org/viewvc?rev=825943&view=rev
Log:
AXIS2-4530
Contributor: Wendy Raschke
XMLFault fix plus verification test

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/util/XMLFaultUtils.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/misc/XMLFaultTest.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/util/XMLFaultUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/util/XMLFaultUtils.java?rev=825943&r1=825942&r2=825943&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/util/XMLFaultUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/util/XMLFaultUtils.java
Fri Oct 16 15:33:12 2009
@@ -675,7 +675,7 @@
         // Set the Node...only applicable for SOAP 1.2
         if (xmlFault.getNode() != null && protocolNS.equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE))
         {
-            soapFault.setFaultRole(xmlFault.getNode());
+            soapFault.setFaultNode(xmlFault.getNode());
         }
 
         return soapFault;

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/misc/XMLFaultTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/misc/XMLFaultTest.java?rev=825943&r1=825942&r2=825943&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/misc/XMLFaultTest.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/misc/XMLFaultTest.java
Fri Oct 16 15:33:12 2009
@@ -91,4 +91,37 @@
 
     }
     
+    /**
+     * Tests that Role and Node
+     * are set properly on SOAP 1.2 Fault.
+     * @throws Exception
+     */
+    public void testCustomRoleNodeFault12() throws Exception {
+        MessageFactory mf = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+        SOAPMessage sm = mf.createMessage();
+        SOAPBody body = sm.getSOAPBody();
+        
+        SOAPFault fault = body.addFault();
+        fault.setFaultRole("TestRole");
+        fault.setFaultNode("http://XMLFaultTest/testCustomRoleNodeFault/");
+        
+        XMLFault xmlFault = XMLFaultUtils.createXMLFault(fault);
+        
+        SOAPFault retFault = XMLFaultUtils.createSAAJFault(xmlFault, body);
+        
+        assertTrue(retFault != null);
+        
+        String role = retFault.getFaultRole();
+        assertTrue(role != null);
+        assertTrue(role.equals("TestRole"));
+        
+        // Actor and role should be the same
+        String actor = retFault.getFaultActor();
+        assertTrue(actor != null);
+        assertTrue(actor.equals("TestRole"));
+
+        String node = retFault.getFaultNode();
+        assertTrue(node != null);
+        assertTrue(node.equals("http://XMLFaultTest/testCustomRoleNodeFault/"));
+    }
 }



Mime
View raw message