LmcGetInfoRequest.java update
Hi all,
It seems that the GetInfoRequest's xml response has been changed but the LmcGetInfoRequest.java does not reflect the changes.
the parseResponseXML method must be updated as follows:
Code:
protected LmcSoapResponse parseResponseXML(Element responseXML)
throws ServiceException {
HashMap prefMap = new HashMap();
LmcGetInfoResponse response = new LmcGetInfoResponse();
// iterate over all the elements we received
for (Iterator it = responseXML.elementIterator(); it.hasNext();) {
Element e = (Element) it.next();
// find out what element it is and go process that
String elementType = e.getQName().getName();
if (elementType.equals(AccountConstants.E_NAME)) {
response.setAcctName(e.getText());
} else if (elementType.equals(AccountConstants.E_LIFETIME)) {
response.setLifetime(e.getText());
} else if (elementType.equals(AccountConstants.E_PREFS)) {
// add child preferences to our map
for (Iterator prefsIt = e.elementIterator(); prefsIt.hasNext();) {
Element pref = (Element) prefsIt.next();
addPrefToMultiMap(prefMap, pref);
}
}
}
if (!prefMap.isEmpty())
response.setPrefMap(prefMap);
return response;
}
The changes are from
Code:
} else if (elementType.equals(AccountConstants.E_PREF)) {
// add this preference to our map
addPrefToMultiMap(prefMap, e);
}
to
Code:
} else if (elementType.equals(AccountConstants.E_PREFS)) {
// add child preferences to our map
for (Iterator prefsIt = e.elementIterator(); prefsIt.hasNext();) {
Element pref = (Element) prefsIt.next();
addPrefToMultiMap(prefMap, pref);
}
}