Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0D05F1074F for ; Wed, 4 Sep 2013 10:48:31 +0000 (UTC) Received: (qmail 34017 invoked by uid 500); 4 Sep 2013 10:48:29 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 33939 invoked by uid 500); 4 Sep 2013 10:48:28 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 33843 invoked by uid 99); 4 Sep 2013 10:48:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Sep 2013 10:48:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Sep 2013 10:48:21 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 23120238890D; Wed, 4 Sep 2013 10:48:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1519978 - in /cxf/branches/2.7.x-fixes: services/xkms/xkms-client/ services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/client/ services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/ systests/ws-security/... Date: Wed, 04 Sep 2013 10:47:59 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130904104800.23120238890D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: coheigea Date: Wed Sep 4 10:47:59 2013 New Revision: 1519978 URL: http://svn.apache.org/r1519978 Log: Making additional JAXB Context classes available to XKMSInvoker + fixing X509 File handler Conflicts: services/xkms/xkms-client/pom.xml Modified: cxf/branches/2.7.x-fixes/services/xkms/xkms-client/pom.xml cxf/branches/2.7.x-fixes/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/client/XKMSInvoker.java cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/xkms/xkms-server.xml Modified: cxf/branches/2.7.x-fixes/services/xkms/xkms-client/pom.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-client/pom.xml?rev=1519978&r1=1519977&r2=1519978&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/services/xkms/xkms-client/pom.xml (original) +++ cxf/branches/2.7.x-fixes/services/xkms/xkms-client/pom.xml Wed Sep 4 10:47:59 2013 @@ -45,9 +45,14 @@ ${project.version} - net.sf.ehcache - ehcache-core - ${cxf.ehcache.version} + org.apache.cxf + cxf-rt-frontend-jaxws + ${project.version} + + + net.sf.ehcache + ehcache-core + ${cxf.ehcache.version} org.apache.cxf Modified: cxf/branches/2.7.x-fixes/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/client/XKMSInvoker.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/client/XKMSInvoker.java?rev=1519978&r1=1519977&r2=1519978&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/client/XKMSInvoker.java (original) +++ cxf/branches/2.7.x-fixes/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/client/XKMSInvoker.java Wed Sep 4 10:47:59 2013 @@ -26,15 +26,17 @@ import java.security.cert.CertificateFac import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.UUID; import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; -import javax.xml.ws.BindingProvider; import org.apache.cxf.Bus; import org.apache.cxf.bus.spring.SpringBusFactory; +import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; import org.apache.cxf.xkms.exception.ExceptionMapper; import org.apache.cxf.xkms.exception.XKMSException; import org.apache.cxf.xkms.exception.XKMSLocateException; @@ -42,6 +44,7 @@ import org.apache.cxf.xkms.exception.XKM import org.apache.cxf.xkms.exception.XKMSValidateException; import org.apache.cxf.xkms.handlers.Applications; import org.apache.cxf.xkms.handlers.XKMSConstants; +import org.apache.cxf.xkms.model.extensions.ResultDetails; import org.apache.cxf.xkms.model.xkms.KeyBindingEnum; import org.apache.cxf.xkms.model.xkms.LocateRequestType; import org.apache.cxf.xkms.model.xkms.LocateResultType; @@ -56,7 +59,6 @@ import org.apache.cxf.xkms.model.xmldsig import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3._2002._03.xkms_wsdl.XKMSPortType; -import org.w3._2002._03.xkms_wsdl.XKMSService; public class XKMSInvoker { private static final Logger LOG = LoggerFactory.getLogger(XKMSInvoker.class); @@ -81,20 +83,22 @@ public class XKMSInvoker { } public XKMSInvoker(String endpointAddress, Bus bus) { - + if (bus != null) { SpringBusFactory.setDefaultBus(bus); SpringBusFactory.setThreadDefaultBus(bus); } - XKMSService xkmsService = new XKMSService(); - xkmsConsumer = xkmsService.getPort(XKMSPortType.class); + JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); + factory.setServiceClass(XKMSPortType.class); + factory.setAddress(endpointAddress); - if (endpointAddress != null && !"".equals(endpointAddress)) { - ((BindingProvider)xkmsConsumer).getRequestContext().put( - BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress - ); - } + Map properties = new HashMap(); + properties.put("jaxb.additionalContextClasses", + new Class[] {ResultDetails.class}); + factory.setProperties(properties); + + xkmsConsumer = (XKMSPortType)factory.create(); } public X509Certificate getServiceCertificate(QName serviceName) { Modified: cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java?rev=1519978&r1=1519977&r2=1519978&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java (original) +++ cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java Wed Sep 4 10:47:59 2013 @@ -215,7 +215,10 @@ public class FileCertificateRepo impleme } } - return result.get(0); + if (!result.isEmpty()) { + return result.get(0); + } + return null; } @Override @@ -239,6 +242,9 @@ public class FileCertificateRepo impleme } } - return result.get(0); + if (!result.isEmpty()) { + return result.get(0); + } + return null; } } Modified: cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/xkms/xkms-server.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/xkms/xkms-server.xml?rev=1519978&r1=1519977&r2=1519978&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/xkms/xkms-server.xml (original) +++ cxf/branches/2.7.x-fixes/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/xkms/xkms-server.xml Wed Sep 4 10:47:59 2013 @@ -99,10 +99,18 @@ + + + + + + +