I am writing java code trying to convert an IPentahoResultSet to JSON so I can send it to a server using apache commons httpclient. I could not find any way to convert this pentaho result set to JSON. Any help will be appreciated. I have tried this code to serialize it, but it does not work. I think it is meant to serialize classes not resultsets.
import flexjson.JSONSerializer;
import org.pentaho.commons.connection.marshal.MarshallableResultSet;
.
.
.
IPentahoResultSet data;
//data will contain result of executing and MDX against Mondrian
MarshallableResultSet result = new MarshallableResultSet();
result.setResultSet(data);
JSONSerializer serializer = new JSONSerializer();
String json = serializer.deepSerialize( result );