Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 85125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:02:24+00:00 2026-05-10T22:02:24+00:00

Goal Java client for Yahoo’s HotJobs Resumé Search REST API . Background I’m used

  • 0

Goal

Java client for Yahoo’s HotJobs Resumé Search REST API.

Background

I’m used to writing web-service clients for SOAP APIs, where wsimport generates proxy stubs and you’re off and running. But this is a REST API, which is new to me.

Details

  • REST API
  • No WADL
  • No formal XML schema (XSD or DTD files). There are example XML request/response pairs.
  • No example code provided

Progress

I looked at question Rest clients for Java?, but the automated solutions there assume you are providing both the server and the client, with JAXB invoked on POJOs to generate a schema and a REST API.

Using Jersey (a JAX-RS implementation), I have been able to make a manual HTTP request:

import com.sun.jersey.api.client.*;  ...  ClientConfig clientConfig = new DefaultClientConfig(); Client client = Client.create(clientConfig);  WebResource webResource = client.resource('https://hj.yahooapis.com/v1/HJAuthTokens'); webResource.accept('application/xml');  // body is a hard-coded string, with replacements for the variable bits String response = webResource.post(String.class, body);  // parse response into a org.w3c.dom.Document // interface with Document via XPATH, or write my own POJO mappings 

The response can look like:

<?xml version='1.0' encoding='utf-8'?>    <Response>        <ResponseCode>0</ResponseCode>        <ResponseMessage>Login successful</ResponseMessage>     <Token>NTlEMTdFNjk3Qjg4NUJBNDA3MkJFOTI3NzJEMTdDNDU7bG9jYWxob3N0LmVnbGJwLmNvcnAueWFob28uY29tO0pVNWpzRGRhN3VhSS4yQVRqRi4wWE5jTWl0RHVVYzQyX3luYWd1TjIxaGx6U0lhTXN3LS07NjY2MzM1OzIzNDY3NTsxMjA5MDE2OTE5OzZCM1RBMVNudHdLbl9VdFFKMFEydWctLQ==</Token>    </Response>   

Or, it can look like:

<?xml version='1.0' encoding='utf-8'?>    <yahoo:error xmlns:yahoo='http://www.yahooapis.com/v1/base.rng' xml:lang='en-US'>        <yahoo:description>description</yahoo:description>        <yahoo:detail>            <ErrorCode>errorCode</ErrorCode>        </yahoo:detail>    </yahoo:error>   

Questions

  • Is there a way to auto-generate POJOs which can be marshalled/unmarshalled without a formal schema?
  • Should I attempt to generate those POJOs by hand, with JAXB annotations?
  • Is there some tool I should be leveraging so I don’t have to do all this manually?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:02:25+00:00Added an answer on May 10, 2026 at 10:02 pm

    It’s interesting that they provide an HTTP URL as the namespace URI for the schema, but don’t actually save their schema there. That could be an oversight on their part, which an email or discussion-list posting could correct.

    One approach is to create your own schema, but this seems like a lot of work for little return. Given how simple the messages are, I wonder if you even need a POJO to wrap them? Why not just have a handler that extracts the data you need using XPath?


    Edit: blast from the past, but I saw the comment, reread the question, and realized that the first sentence was hard to understand. So, clarification:

    One very good habit, if you’re going to write a publicly accessible web service, is to make your schema document available at the same URL that you use for the schema’s namespace URI — or better, have that URL be a link to complete documentation (the W3C XSD namespace is itself a good example: http://www.w3.org/2001/XMLSchema).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 88k
  • Answers 88k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First, to answer your questions: No. In fact, I argued… May 11, 2026 at 5:45 pm
  • Editorial Team
    Editorial Team added an answer You can use RuntimeHelpers.GetHashCode(object) which calls object.GetHashCode() non-virtually - this… May 11, 2026 at 5:45 pm
  • Editorial Team
    Editorial Team added an answer No packets will hit the network. Unplug your network cable… May 11, 2026 at 5:45 pm

Related Questions

Goal Java client for Yahoo's HotJobs Resumé Search REST API . Background I'm used
I'm working with a start-up, mostly doing system administration and I've come across a
I have a question on the best way of exposing an asynchronous remote interface.
I'm asking for a suitable architecture for the following Java web application: The goal
I've got a Java client that needs to access a remote database. It is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.