아마도 간단한 질문이지만 이것에 대한 자습서를 찾을 수 없었습니다. 자바에서 linkedin api를 사용하고 있으며 android에서 구현하고 있습니다. 교육, 직위 및 기타 정보를 얻을 수는 있지만 기술을 검색하는 방법을 모르겠습니다. 여기에 내가 가지고있는 것이있다 :linkedin API에서 기술을 습득 하시겠습니까?
private static final String PROFILE_URL = "https://api.linkedin.com/v1/people/~:(id,phone-numbers,headline,educations,positions, skills, recommendations-received)?oauth2_access_token=";
public CareerPluginImpl(final ProviderSupport providerSupport) {
this.providerSupport = providerSupport;
}
public Career getCareerDetails() throws Exception {
LOG.info("Fetching career details from " + PROFILE_URL);
Response serviceResponse = null;
try {
serviceResponse = providerSupport.api(PROFILE_URL
+ providerSupport.getAccessGrant().getKey());
} catch (Exception ie) {
throw new SocialAuthException(
"Failed to retrieve the career details from " + PROFILE_URL, ie);
}
Element root;
try {
root = XMLParseUtil.loadXmlResource(serviceResponse.getInputStream());
} catch (Exception e) {
throw new ServerDataException(
"Failed to parse the career details from response."
+ PROFILE_URL, e);
}
Career career = null;
if (root != null) {
career = new Career();
Education[] educationsArr = null;
Position[] positionsArr = null;
Recommendation[] recommendationsArr = null;
Skill[] skillsArr = null;
String headline = XMLParseUtil.getElementData(root, "headline");
career.setHeadline(headline);
String id = XMLParseUtil.getElementData(root, "id");
career.setId(id);
// get Skills
NodeList skills = root
.getElementsByTagName("skills");
if (skills != null && skills.getLength() > 0) {
LOG.debug("skills count "
+ skills.getLength());
skillsArr = new Skill[skills.getLength()];
for (int i = 0; i < skills.getLength(); i++) {
Skill skillObj = new Skill();
Element skillEl = (Element) skills.item(i);
String sid = XMLParseUtil.getElementData(skillEl, "id");
if (sid != null) {
skillObj.setSkillId(sid);
}
String text = XMLParseUtil.getElementData(skillEl, "skill");
if (text != null) {
skillObj.setSkillText(text);
}
skillsArr[i] = skillObj;
}
}
if (skillsArr != null) {
career.setSkills(skillsArr);
}
}
return career;
}
경력과 함께 반환 된 기술 목록은 항상 null로 돌아온 것으로 보인다. 나는 내가 얻으려고하는 대상에 대해 확실하지 않고, 문서가 실제로 도움이되지 않는다. 어떤 아이디어?
반환 된 XML의 내용을 확인 했습니까? – njzk2
어떻게해야할지 모르겠습니다. 나는 일식을 사용하고있다. – Will