axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r367956 - in /webservices/axis2/trunk/java/modules: integration/test/org/apache/axis2/security/InteropTestBase.java security/src/org/apache/axis2/security/trust/token/CancelTarget.java security/src/org/apache/axis2/security/util/Axis2Util.java
Date Wed, 11 Jan 2006 07:13:11 GMT
Author: ruchithf
Date: Tue Jan 10 23:12:55 2006
New Revision: 367956

URL: http://svn.apache.org/viewcvs?rev=367956&view=rev
Log:
Removing TrustException import from the Axis2Util in security module

Modified:
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/CancelTarget.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java?rev=367956&r1=367955&r2=367956&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java
Tue Jan 10 23:12:55 2006
@@ -120,7 +120,7 @@
     private String targetEpr = "http://127.0.0.1:" +
             // 5556 +
             UtilServer.TESTING_PORT + "/axis2/services/PingPort";
-
+ 
     public InteropTestBase() {
         super();
     }

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/CancelTarget.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/CancelTarget.java?rev=367956&r1=367955&r2=367956&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/CancelTarget.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/token/CancelTarget.java
Tue Jan 10 23:12:55 2006
@@ -15,16 +15,15 @@
  */
 package org.apache.axis2.security.trust.token;
 
+import javax.xml.namespace.QName;
+
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.security.trust.Constants;
 import org.apache.axis2.security.trust.TrustException;
 import org.apache.axis2.security.util.Axis2Util;
 import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSSecurityException;
 import org.apache.ws.security.message.token.SecurityTokenReference;
 
-import javax.xml.namespace.QName;
-
 public class CancelTarget extends CompositeToken {
 
     public static final QName TOKEN = new QName(Constants.WST_NS, Constants.LN.CANCEL_TARGET,
Constants.WST_PREFIX);
@@ -35,7 +34,11 @@
     public CancelTarget(SecurityTokenReference securityTokenReference) throws TrustException
{
 		super();
 		this.securityTokenReference = securityTokenReference;
-		this.tokenElement.addChild(Axis2Util.toOM(this.securityTokenReference.getElement()));
+        try {
+            this.tokenElement.addChild(Axis2Util.toOM(this.securityTokenReference.getElement()));
+        } catch (Exception e) {
+            throw new TrustException(e.getMessage(), e);
+        }
 	}
     
     /**
@@ -90,7 +93,11 @@
 		}
 		
 		this.securityTokenReference = securityTokenReference;
-		this.tokenElement.addChild(Axis2Util.toOM(this.securityTokenReference.getElement()));
+        try {
+            this.tokenElement.addChild(Axis2Util.toOM(this.securityTokenReference.getElement()));
+        } catch (Exception e) {
+            throw new TrustException(e.getMessage(), e);
+        }
 	}
 	
 	/**
@@ -126,8 +133,8 @@
 		if(el.equals(new QName(WSConstants.WSSE_NS,SecurityTokenReference.SECURITY_TOKEN_REFERENCE))
&& this.targetToken == null) {
 			try {
 				this.securityTokenReference = new SecurityTokenReference(Axis2Util.toDOM(element));
-			} catch (WSSecurityException wsse) {
-				throw new TrustException(wsse.getMessage(),wsse);
+			} catch (Exception e) {
+				throw new TrustException(e.getMessage(), e);
 			}
 		} else if(this.securityTokenReference == null) {
 			this.targetToken = element;

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java?rev=367956&r1=367955&r2=367956&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/Axis2Util.java
Tue Jan 10 23:12:55 2006
@@ -16,12 +16,18 @@
 
 package org.apache.axis2.security.util;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
 import org.apache.axis2.om.DOOMAbstractFactory;
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.impl.dom.DocumentImpl;
 import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
 import org.apache.axis2.security.handler.WSSHandlerConstants;
-import org.apache.axis2.security.trust.TrustException;
 import org.apache.axis2.soap.SOAP11Constants;
 import org.apache.axis2.soap.SOAP12Constants;
 import org.apache.axis2.soap.SOAPEnvelope;
@@ -32,13 +38,6 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-
 /**
  * Utility class for the Axis2-WSS4J Module
  */
@@ -111,10 +110,9 @@
 	 * Converts a given DOM Element to an OMElement.
 	 * @param element
 	 * @return Returns OMElement.
-	 * @throws TrustException
+	 * @throws Exception
 	 */
-	public static OMElement toOM(Element element) throws TrustException {
-		try {
+	public static OMElement toOM(Element element) throws Exception {
 			ByteArrayOutputStream os = new ByteArrayOutputStream();
 			XMLUtils.outputDOM(element, os, true);
 			
@@ -126,10 +124,6 @@
 			builder.setCache(true);
 
 			return builder.getDocumentElement();
-		} catch (XMLStreamException e) {
-			throw new TrustException(TrustException.ERROR_IN_CONVERTING_TO_OM,
-					TrustException.ERROR_IN_CONVERTING_TO_OM, new Object[] {}, e);
-		}
 	}
 	
 
@@ -137,10 +131,9 @@
 	 * Converts a given OMElement to a DOM Element.
 	 * @param element
 	 * @return Returns Element.
-	 * @throws TrustException
+	 * @throws Exception
 	 */
-	public static Element toDOM(OMElement element) throws TrustException {
-		try {
+	public static Element toDOM(OMElement element) throws Exception {
 			ByteArrayOutputStream baos = new ByteArrayOutputStream();
 			element.serialize(baos);
 			ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
@@ -148,9 +141,5 @@
 			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
 			factory.setNamespaceAware(true);
 			return factory.newDocumentBuilder().parse(bais).getDocumentElement();
-		} catch (Exception e) {
-			throw new TrustException(TrustException.ERROR_IN_CONVERTING_TO_DOM,
-					TrustException.ERROR_IN_CONVERTING_TO_DOM, new Object[] {}, e);			
-		}
 	}
 }



Mime
View raw message