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));
}
Aggregations