*
* @return Profile - returns the fetched Profile
* @throws ProfileServiceException
*/
public Profile getMyProfile() throws ProfileServiceException {
JsonObject result = null;
try {
//making a call directly here using ClientService's get method,
Response response = endpoint.getClientService().get(ProfileConstants.GETUSERIDENTITY.getUrl(), ClientService.FORMAT_JSON);
result = (JsonObject) response.getData() ;
} catch (ClientServicesException cse) {
throw new ProfileServiceException(cse, Messages.InvalidValue_1);
}
String userId = (String) result.getJsonProperty("subscriberid");
if (StringUtil.isEmpty(userId)) {
throw new ProfileServiceException(null, Messages.InvalidValue_2);
}
return getProfile(userId);
}