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

  • SEARCH
  • Home
  • 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 6768671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:06:08+00:00 2026-05-26T15:06:08+00:00

I am trying to connect via an XML RPC call to an API that

  • 0

I am trying to connect via an XML RPC call to an API that takes as input a list of phrases, and gives as output– “Echoes back a struct of keyphrases each with a single item list of the original keyphrase.”

I am trying to use regular hashmap parsing code in the following way–

  hMap = (HashMap<String, Integer>) untypedResult;

        Set set = hMap.entrySet();

        Iterator i = set.iterator();

        while(i.hasNext()){
          Map.Entry me = (Map.Entry)i.next();
          resp.getWriter().println(me.getKey() + " : " + me.getValue() );
        }

The output that I am getting is as follows–

Response for GetThesaurusKeyPhrases—-
mp3 : [Ljava.lang.Object;@76c3358b
britney spears : [Ljava.lang.Object;@9f07597

How do I obtain the values correctly? What I think is that I should parse each value (the me.getvalue part) correctly… but I am confused on how to go about doing this… Any help would be appreciated.

  • 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. Editorial Team
    Editorial Team
    2026-05-26T15:06:08+00:00Added an answer on May 26, 2026 at 3:06 pm

    You might need to cast each key and value, ie (String)me.getKey() and see what you get.

    From the snippet you’ve posted, it is possible that the HashMap<String, Integer> in your cast is incorrect. The original HashMap may have been defined as simply a HashMap or HashMap<Object, Object> since your variable name is untypedResult. I tried the following and it works as expected:

    <!-- language: lang-java -->
    public static void main(String[] args) {
        HashMap<String, Integer> hMap = new HashMap<String, Integer>();
        hMap.put("Hi1", new Integer(1));
        hMap.put("Hi2", new Integer(2));
        hMap.put("Hi3", new Integer(3));
        hMap.put("Hi4", new Integer(4));
        Set set = hMap.entrySet();
        Iterator i = set.iterator();
        while(i.hasNext()){
            Map.Entry me = (Map.Entry)i.next();
            System.out.println(me.getKey().getClass().getName() + " : " + me.getValue().getClass().getName() );
            System.out.println(me.getKey() + " : " + me.getValue() );
        }
    }
    

    The output for this block is:

    java.lang.String : java.lang.Integer
    Hi2 : 2
    java.lang.String : java.lang.Integer
    Hi1 : 1
    java.lang.String : java.lang.Integer
    Hi4 : 4
    java.lang.String : java.lang.Integer
    Hi3 : 3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to connect a datagrid to an HTTPService via a simple external XML
I'm trying to connect to the Twitter API via an AS3 app, but I
When trying to connect to an ORACLE user via TOAD (Quest Software) or any
I am trying to connect to a piece of hardware via TCP/IP. I had
I'm trying to connect from my ms windows 7 via the odbc administrator to
While trying to connect to a database that's set to read only, the connection
I am trying to connect to twitter via TwitterVB and the following code does
I have a device to which I'm trying to connect via a socket, and
I'm trying to use ldaptor to connect via startTLS to a LDAP server. Searching
I am trying to write Connect calls via a NTLM authenticating proxy server. I

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.