This function runs an existing report, using its report_id. This is obtained from the get_reports function and returns raw XML results.
Class |
Name |
Type |
Required |
Details |
ExecuteReportRawRequest |
userId |
String |
Yes |
The caller's user name |
ExecuteReportRawRequest |
password |
String |
Yes |
The caller's password |
ExecuteReportRawRequest |
pageLength |
Integer |
Yes |
The page length |
ExecuteReportRawRequest |
persistHandle |
String |
No |
A random string to persist the data |
ExecuteReportRawRequest |
recordStart |
Integer |
No |
The starting index of records returned |
ExecuteReportRawRequest |
recordCount |
Integer |
No |
The count of records being fetched |
Class |
Name |
Type |
Required |
Details |
ExecuteReportRawResponse |
success |
boolean |
Yes |
True is succeeded False if failed |
ExecuteReportRawResponse |
returnCode |
String |
No |
See Appendix for details |
ExecuteReportRawResponse |
returnMessage |
String |
No |
Human readable message |
ExecuteReportRawResponse |
xmlResults |
String |
No |
The search results in XML format |
public static void testExecuteReportRaw(EVQueryServiceStub stub) {
try {
ExecuteReportRawDocument reqEnvelope =
ExecuteReportRawDocument.Factory.newInstance();
ExecuteReportRawRequest request =
reqEnvelope.addNewExecuteReportRaw().addNewRequest();
request.setUserId(ServiceClientHelper.ADMIN_USER_ID);
request.setPassword(ServiceClientHelper.ADMIN_PASSWORD);
request.setPageLength(100);
request.setRecordStart(1);
request.setRecordCount(120);
request.setPersistHandle(ServiceClientHelper.randStr);
// this query exists on all sites.
request.setReportId(ServiceClientHelper.STANDARD_REPORT);
ExecuteReportRawResponseDocument resEnvelope = stub.executeReportRaw(reqEnvelope);
ExecuteReportRawResponse response =
resEnvelope.getExecuteReportRawResponse().getReturn();
if (response.getSuccess()) {
System.out.println("success: [" + response.getReturnCode() + "] : " +
response.getReturnMessage());
System.out.println("XML Report:n" + response.getXmlReport());
} else {
System.out.println("failure: [" + response.getReturnCode() + "] : " +
response.getReturnMessage());
}
} catch (Exception e) {
e.printStackTrace();
System.err.println("nnn");
}
}