public PrivacyFieldDTO[] getUserProfile(String userId, String profileName, String[] claimValues) { try { org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO[] result = stub.getUserProfile(userId, profileName, claimValues); PrivacyFieldDTO[] profileData = new PrivacyFieldDTO[result.length]; int index = 0; for (org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO data : result) { PrivacyFieldDTO obj = new PrivacyFieldDTO(); obj.setFieldName(data.getFieldName()); obj.setVisibilityValue(data.getVisibilityValue()); profileData[index++] = obj; } return profileData; } catch (RemoteException e) { log.error(e.getMessage(), e); return new PrivacyFieldDTO[0]; } }