Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 18626 invoked from network); 11 Jan 2006 07:13:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Jan 2006 07:13:36 -0000 Received: (qmail 66484 invoked by uid 500); 11 Jan 2006 07:13:34 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 66255 invoked by uid 500); 11 Jan 2006 07:13:34 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 66241 invoked by uid 500); 11 Jan 2006 07:13:34 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 66238 invoked by uid 99); 11 Jan 2006 07:13:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jan 2006 23:13:33 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 10 Jan 2006 23:13:32 -0800 Received: (qmail 18508 invoked by uid 65534); 11 Jan 2006 07:13:12 -0000 Message-ID: <20060111071312.18507.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: axis2-cvs@ws.apache.org From: ruchithf@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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); - } } }