|
From: Tomas G. <to...@pr...> - 2015-06-04 15:23:29
|
Hi, You can look how it is done in the EJBCA clientToolBox WebService command line interface. The source code is included. Cheers, Tomas ----- Save time and money with an Enterprise support subscription. Please see www.primekey.se for more information. https://www.primekey.se/technologies/products-overview/ https://www.primekey.se/service-support/support/ On 2015-06-04 16:24, Raadush wrote: > Hello. Im trying to use ejbca's web service interface, but when I try > call some method, I > recieve "AuthorizationDeniedException_Exception:Error no client > certificate recieved used for authentication". I suppose I have to add > client certificate authorization somewhere, but got no idea how to. Can > somebody show me the right way of doing so? My simple class is here > (exception is thrown ar service.certificateRequest call. I also tired > call webservice through SoapUi only to get the very same exception): > > public class EjbcConnector { > > EjbcaWS service; > > public EjbcConnector() { > JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); > factory.setServiceClass(EjbcaWS.class); > factory.setAddress("http://localhost:8080/ejbca/ejbcaws/ejbcaws"); > service = (EjbcaWS) factory.create(); > > } > > public String certificateRequest(String certificate) throws Exception { > > UserDataVOWS userData = new UserDataVOWS(); > userData.setUsername("Test"); > userData.setPassword("Test"); > userData.setCaName("ManagementCA"); > try { > CertificateResponse response = > service.certificateRequest(userData, certificate, 0, null, "CERTIFICATE"); > return Base64.encodeBase64String(response.getData()); > } catch (Exception ex) { > throw ex; > } > } > > } > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Ejbca-develop mailing list > Ejb...@li... > https://lists.sourceforge.net/lists/listinfo/ejbca-develop > |