Reputation: 11
I am new to Spago bi and my requirement is to get the list of available data sets with the spagoBI using spago sdk . Any help on how to use the sdk or any sample would be really helpful
I tried this
String user1 = "biadmin";
String password1 = "biadmin";
try {
DataSetsSDKServiceProxy proxy = new DataSetsSDKServiceProxy(user1, password1);
proxy.setEndpoint("http://localhost:8080/SpagoBI/sdk/DataSetsSDKService");
SDKDataSet[] datasets = proxy.getDataSets();
System.out.println("*** dataset: " + datasets.length);
} catch (Exception e) {
e.printStackTrace();
But i am getting the following exception
org.xml.sax.SAXException: Invalid element in it.eng.spagobi.sdk.datasets.bo.SDKDataSet - active AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXException: Invalid element in it.eng.spagobi.sdk.datasets.bo.SDKDataSet - active faultActor: faultNode: faultDetail:
Upvotes: 1
Views: 482
Reputation: 5899
I am doing the same, I have modified your code just a little bit and I confirm it is ok. Therefore, I would think it is due to the web service or maybe it is caused by a conflict in anywhere else..Do you have the SpagoSDK running up on your server? Did you check the logs on Tomcat?..I mean coul you put more info?
Anyway, I am putting my code and the response (Linux + SpagoBI 5)
import it.eng.spagobi.sdk.datasets.bo.SDKDataSet;
import it.eng.spagobi.sdk.proxy.DataSetsSDKServiceProxy;
public class main {
public static void main(String[] args) {
String user1 = "biadmin";
String password1 = "biadmin";
try {
DataSetsSDKServiceProxy proxy = new DataSetsSDKServiceProxy(user1, password1);
proxy.setEndpoint("http://localhost:8080/SpagoBI/sdk/DataSetsSDKService");
SDKDataSet[] datasets = proxy.getDataSets();
System.out.println("*** dataset: " + datasets);
System.out.println("*** num of dataset: " + datasets.length);
for (int i = 0; i < datasets.length; i++) {
System.out.println("*** Description: " + datasets[i].getName());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
I am getting the next response (my own datasets), so it is working
run:
*** dataset: [Lit.eng.spagobi.sdk.datasets.bo.SDKDataSet;@dd8bec
*** num of dataset: 10
*** Name: test
*** Name: test_chart
*** Name: txs_st
*** Name: txs st2
*** Name: EXCEL_PERSIST
*** Name: excel test
*** Name: excel test optim
*** Name: excel test optim bar
*** Name: SIMPLE BAR CHART TEST
*** Name: SIMPLE_BAR_CHART
Bye
Upvotes: 0