Nobody respond to this issue. My analysis is when the XstreamRepresentation is
created and the getObject() is called on this representation. The
implementation of the XStream Extension of getObject() calls the following
method on representation
result = (T) getXstream().fromXML(this.representation.getStream());
Now when I debug the code at this line, the representation has a null
inputstream. But the ClientInfo object has an inputstream which can not be
accessed since it is private.
How do I get it to work? My Client program is below and the JSON object
returned is as follows
public static void main(String[] args) {
try {
ClientResource cr = new
ClientResource("http://tsbu-sr21:8080/rsoapis/rest/roomlist");
cr.getClientInfo().getAcceptedMediaTypes().add(new
Preference<MediaType>(MediaType.APPLICATION_JSON));
Representation resp = cr.get();
if (cr.getStatus().isSuccess() && cr.getResponseEntity().isAvailable()) {
cr.getResponseEntity().write(System.out);
XstreamRepresentation<RoomUIView[]> xStream = new
XstreamRepresentation<RoomUIView[]>(cr.getResponseEntity());
System.out.println(xStream.getJsonDriverClass());
RoomUIView[] rooms = xStream.getObject();
System.out.println("Rooms Fetched=" + rooms.length);
}
} catch (ResourceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
{"com.cisco.ts.scheduler.api.object.RoomUIView-array":{"com.cisco.ts.scheduler.dataaccess.RoomUIViewImpl":[{"itsRoomObj":{"@class":"com.cisco.ts.scheduler.dataaccess.RoomImpl","null":"","string":"Room","boolean":[false,false,"lastSearchTime"]}}],"entry":[{"string":"telepresenceEquipment.TelepresenceEquipmentID","com.cisco.ts.scheduler.dataaccess.TelepresenceEquipmentImpl":{"null":"","string":"TelepresenceEquipment","boolean":[false,false,"deviceCCMSysId","tsbu-ctm23"]}},{"string":["deviceSSHUsername","admin"]},{"string":"display","null":""},{"string":"TelepresenceEquipmentID","long":2},{"string":"modelType","int":478},{"string":"deviceIPAddress","null":""},{"string":"concierge.conciergeID","null":""},{"string":["directoryNumber",16200]},{"string":"dialplaninfo.dialPlanInfoID","com.cisco.ts.scheduler.dataaccess.DialPlanInfoImpl":{"null":"","string":"DialPlanInfo","boolean":[false,false,"countryCode",1]},"entry":[{"string":["nationalDialingDigits",1]},{"string":["externalAccessCode",9]},{"string":["interSiteAccessCode","
"]},{"string":["areaCode",408]},{"string":["localNumber",5272465]},{"string":["siteCode","
"]},{"string":["internationalDialingDigits","011"]},{"string":"dialPlanInfoID","long":278},{"string":"CCMId","null":""},{"string":["deviceMACAddress","0019AA043876"]},{"string":["deviceName","SEP0019AA043876"]},{"string":"modelIndex","int":1},{"string":"CTSSOAPSecurityStatus","int":2},{"string":"CCMTBConnectivityStatus","int":2},{"string":["deviceSSHPassword","cisco"]},{"string":"SRTBConnectivityStatus","int":2},{"string":["version","CTS
WED(4556)
20"]},{"string":"deviceAdminState","int":1},{"string":"latestQualitySupported","int":6},{"string":["description","Pilot
Mode Room
18"]},{"string":"quality","int":0}]},{"string":"resyncEndTime","sql-timestamp":"2010-07-23
22:26:16.0"},{"string":"EnableTentativeProcessing","boolean":false},{"string":"assignedClusterNodeID","int":1},{"string":"roomTPErrStatus","int":2},{"string":["geographyCountry","United
States"]},{"string":"dominoDatabase.databasename","null":""},{"string":"verificationStatus","int":1},{"string":["name","[email protected]"]},{"string":"roomID","int":2},{"string":"capacity","int":1},{"string":["timeZone","TIMEZONE_AMERICA_LOS_ANGELES"]},{"string":"telepresenceGroupId","null":""},{"string":"configurationStatus","int":1},{"string":"roomTPStatus","int":1},{"string":"resyncStatus","int":2},{"string":"resyncStartTime","sql-timestamp":"2010-07-23
22:25:38.0"},{"string":["geographyLocation","San
Jose"]},{"string":["displayName","TelepresenceRoom18"]},{"itsRoomObj":{"@class":"com.cisco.ts.scheduler.dataaccess.RoomImpl","null":"","string":"Room","boolean":[false,false,"lastSearchTime"]}},{"string":"telepresenceEquipment.TelepresenceEquipmentID","com.cisco.ts.scheduler.dataaccess.TelepresenceEquipmentImpl":{"null":"","string":"TelepresenceEquipment","boolean":[false,false,"deviceCCMSysId","tsbu-ctm23"]},"entry":[{"string":["deviceSSHUsername","admin"]},{"string":"display","null":""},{"string":"TelepresenceEquipmentID","long":4},{"string":"modelType","int":478},{"string":["deviceIPAddress","10.22.153.81"]},{"string":"concierge.conciergeID","null":""},{"string":["directoryNumber",16199]},{"string":"dialplaninfo.dialPlanInfoID","com.cisco.ts.scheduler.dataaccess.DialPlanInfoImpl":{"null":"","string":"DialPlanInfo","boolean":[false,false,"countryCode",1]},"entry":[{"string":["nationalDialingDigits",1]},{"string":["externalAccessCode",9]},{"string":["interSiteAccessCode","
"]},{"string":["areaCode",408]},{"string":["localNumber",5272465]},{"string":["siteCode","
"]},{"string":["internationalDialingDigits","011"]},{"string":"dialPlanInfoID","long":279},{"string":"CCMId","null":""},{"string":["deviceMACAddress","0019AA044A49"]},{"string":["deviceName","SEP0019AA044A49"]},{"string":"modelIndex","int":1},{"string":"CTSSOAPSecurityStatus","int":2},{"string":"CCMTBConnectivityStatus","int":1},{"string":["deviceSSHPassword","cisco"]},{"string":"SRTBConnectivityStatus","int":1},{"string":["version","CTS
1.6.1(3990)
"]},{"string":"deviceAdminState","int":1},{"string":"latestQualitySupported","int":6},{"string":["description","Pilot
mode Room
23"]},{"string":"quality","int":0}]},{"string":"resyncEndTime","sql-timestamp":"2010-07-23
22:04:34.0"},{"string":"EnableTentativeProcessing","boolean":false},{"string":"assignedClusterNodeID","int":1},{"string":"roomTPErrStatus","int":1},{"string":["geographyCountry","United
States"]},{"string":"dominoDatabase.databasename","null":""},{"string":"verificationStatus","int":1},{"string":["name","[email protected]"]},{"string":"roomID","int":22},{"string":"capacity","int":1},{"string":["timeZone","TIMEZONE_AMERICA_LOS_ANGELES"]},{"string":"telepresenceGroupId","null":""},{"string":"configurationStatus","int":1},{"string":"roomTPStatus","int":1},{"string":"resyncStatus","int":2},{"string":"resyncStartTime","sql-timestamp":"2010-07-23
22:04:11.0"},{"string":["geographyLocation","Milpitas"]},{"string":["displayName","TelepresenceRoom23"]},{"itsRoomObj":{"@class":"com.cisco.ts.scheduler.dataaccess.RoomImpl","null":"","string":"Room","boolean":[false,false,"lastSearchTime"]}},{"string":"telepresenceEquipment.TelepresenceEquipmentID","com.cisco.ts.scheduler.dataaccess.TelepresenceEquipmentImpl":{"null":"","string":"TelepresenceEquipment","boolean":[false,false,"deviceCCMSysId","tsbu-ctm23"]},"entry":[{"string":["deviceSSHUsername","admin"]},{"string":"display","null":""},{"string":"TelepresenceEquipmentID","long":5},{"string":"modelType","int":478},{"string":["deviceIPAddress","10.22.153.73"]},{"string":"concierge.conciergeID","null":""},{"string":["directoryNumber",16201]},{"string":"dialplaninfo.dialPlanInfoID","com.cisco.ts.scheduler.dataaccess.DialPlanInfoImpl":{"null":"","string":"DialPlanInfo","boolean":[false,false,"countryCode",1]},"entry":[{"string":["nationalDialingDigits",1]},{"string":["externalAccessCode",9]},{"string":["interSiteAccessCode",8]},{"string":["areaCode",408]},{"string":["localNumber",5216201]},{"string":["siteCode",52]},{"string":["internationalDialingDigits","011"]},{"string":"dialPlanInfoID","long":277},{"string":"CCMId","null":""},{"string":["deviceMACAddress","0019AA04406E"]},{"string":["deviceName","SEP0019AA04406E"]},{"string":"modelIndex","int":1},{"string":"CTSSOAPSecurityStatus","int":2},{"string":"CCMTBConnectivityStatus","int":1},{"string":["deviceSSHPassword","cisco"]},{"string":"SRTBConnectivityStatus","int":2},{"string":["version","CTS
1.6.1(3994)
"]},{"string":"deviceAdminState","int":1},{"string":"latestQualitySupported","int":6},{"string":["description","Pilot
Mode Room
19"]},{"string":"quality","int":0}]},{"string":"resyncEndTime","sql-timestamp":"2010-07-23
20:34:22.0"},{"string":"EnableTentativeProcessing","boolean":false},{"string":"assignedClusterNodeID","int":1},{"string":"roomTPErrStatus","int":1},{"string":"geographyCountry","null":""},{"string":"dominoDatabase.databasename","null":""},{"string":"verificationStatus","int":1},{"string":["name","[email protected]"]},{"string":"roomID","int":23},{"string":"capacity","int":1},{"string":["timeZone","TIMEZONE_AMERICA_LOS_ANGELES"]},{"string":"telepresenceGroupId","null":""},{"string":"configurationStatus","int":1},{"string":"roomTPStatus","int":1},{"string":"resyncStatus","int":2},{"string":"resyncStartTime","sql-timestamp":"2010-07-23
20:34:19.0"},{"string":"geographyLocation","null":""},{"string":["displayName","TelepresenceRoom19"]}]}]}]}}
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2637486