Search in sources :

Example 16 with IUserRoleWebService

use of org.pentaho.platform.security.userroledao.ws.IUserRoleWebService in project pentaho-platform by pentaho.

the class UserRoleEndpointIT method main.

public static void main(String[] args) throws Exception {
    // test against a live server, dev use only
    System.setProperty("com.sun.xml.ws.monitoring.endpoint", "true");
    System.setProperty("com.sun.xml.ws.monitoring.client", "true");
    System.setProperty("com.sun.xml.ws.monitoring.registrationDebug", "FINE");
    System.setProperty("com.sun.xml.ws.monitoring.runtimeDebug", "true");
    Service service = Service.create(new URL("http://localhost:8080/pentaho/webservices/userRoleService?wsdl"), new QName("http://www.pentaho.org/ws/1.0", "userRoleService"));
    IUserRoleWebService userRoleWebService = service.getPort(IUserRoleWebService.class);
    ((BindingProvider) userRoleWebService).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "admin");
    ((BindingProvider) userRoleWebService).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "password");
    // accept cookies to maintain session on server
    ((BindingProvider) userRoleWebService).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
    UserRoleSecurityInfo info = userRoleWebService.getUserRoleSecurityInfo();
    // should be Authenticated
    System.out.println(info.getDefaultRoles().get(0));
}
Also used : UserRoleSecurityInfo(org.pentaho.platform.security.userroledao.ws.UserRoleSecurityInfo) QName(javax.xml.namespace.QName) UserRoleWebService(org.pentaho.platform.security.userroledao.ws.UserRoleWebService) Service(javax.xml.ws.Service) IUserRoleWebService(org.pentaho.platform.security.userroledao.ws.IUserRoleWebService) IUserRoleWebService(org.pentaho.platform.security.userroledao.ws.IUserRoleWebService) URL(java.net.URL)

Aggregations

IUserRoleWebService (org.pentaho.platform.security.userroledao.ws.IUserRoleWebService)16 Test (org.junit.Test)15 UserRoleException (org.pentaho.platform.security.userroledao.ws.UserRoleException)15 ProxyPentahoRole (org.pentaho.platform.security.userroledao.ws.ProxyPentahoRole)9 ProxyPentahoUser (org.pentaho.platform.security.userroledao.ws.ProxyPentahoUser)9 UserRoleSecurityInfo (org.pentaho.platform.security.userroledao.ws.UserRoleSecurityInfo)2 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 QName (javax.xml.namespace.QName)1 Service (javax.xml.ws.Service)1 IPentahoRole (org.pentaho.platform.api.engine.security.userroledao.IPentahoRole)1 IPentahoUser (org.pentaho.platform.api.engine.security.userroledao.IPentahoUser)1 UserRoleWebService (org.pentaho.platform.security.userroledao.ws.UserRoleWebService)1