<%@page import="java.net.URLConnection"%> <%@page import="java.net.URL"%> <%! private static final String cvsId = "$Id: ws_admin_singlesignon.jsp,v 1.1 2012/02/17 02:26:51 steve Exp $"; %> <%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ page import="com.hof.util.*, java.util.*, java.text.*" %> <%@ page import="com.hof.web.form.*" %> <%@ page import="com.hof.mi.web.service.*" %> <% /* DON'T FORGET TO ADD THE FOLLOWING TO web.xml MISTARTUP servlet section EnableQueryWebservice TRUE DisableQueryWebservicePassword TRUE */ AdministrationServiceResponse rs = null; AdministrationServiceRequest rsr = new AdministrationServiceRequest(); AdministrationServiceServiceLocator asi = new AdministrationServiceServiceLocator(); AdministrationServiceInterface rssbs = asi.getAdministrationService(new URL("http://localhost:7171/services/AdministrationService")); rsr.setLoginId("admin@yellowfin.com.au"); rsr.setPassword("test"); rsr.setOrgId(new Integer(1)); rsr.setFunction("METADATASQLQUERY"); //enable logon via userid rsr.setQuery("UPDATE Configuration SET ConfigData = 'YES' WHERE ConfigTypeCode = 'SYSTEM' AND ConfigCode = 'USERID';"); //enable logon via email rsr.setQuery("UPDATE Configuration SET ConfigData = 'NO' WHERE ConfigTypeCode = 'SYSTEM' AND ConfigCode = 'USERID';"); //this is your database password //YOU WON'T NEED TO DO THIS IF YOU HAVE ADDED THE web.xml PARAMS at top of page // rsr.setParameters(new String[] { "" }); rs = rssbs.remoteAdministrationCall(rsr); if ("SUCCESS".equals(rs.getStatusCode()) ) { for (ReportRow r : rs.getQueryResults()) { for (String s: r.getDataValue()) { if (s!=null) out.write(s); out.write(" "); } out.write("
"); } } else { out.write("Failure"); } %>
Done.