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 8338617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:38:51+00:00 2026-06-09T04:38:51+00:00

Actually, the problem is NOT how to do it, but if it’s a design

  • 0

Actually, the problem is NOT how to do it, but if it’s a design mistake. I’m worried because I’ve read a lot about using only standard data types in WS. However, I had no problem implementing one that receives a HashMap, and filling that parameter from PHP with nuSoap.

I have a ParameterBean class with this members (plus getters and setters of course), which includes a HashMap.

private int ID;
private String value;
private String name;
private HashMap<Integer, String> map = new HashMap<Integer, String>();

And a service that receives an instance from this class. Then from the PHP client I invoke:

$map = array(1 => 'Foo', 2 => 'Bar');
$paramsp = array(
    'ID' => '1',
    'value' => 'Some Value',
    'name' => 'A Name',
    'map' => $map
);
$params = array($paramsp);
$resp = $client->call('test',$params);
print_r($client->response);

It works like a charm! Question is: Is this frowned upon? Will this result in a headache in the future in some way?

  • 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-06-09T04:38:53+00:00Added an answer on June 9, 2026 at 4:38 am

    A HashMap is a pretty dang standard data type and should present no problems when used in a web service.

    As you’ve seen, both PHP and Java have no problem dealing with hash maps. JSON supports them (though they’re called “objects”, and don’t have the explicit typing of Java).

    While truly esoteric datatypes might cause problems for web services that are expected to be widely interoperable, hash maps are not in that category and should be used without worry.

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

Sidebar

Related Questions

Problem in Firefox, but ok with Internet Explorer. I tried a lot but not
I actually posted this question because I found similar questions but not a perfect
I have a problem, but maybe this is not a problem actually! Why below
My specific problem is actually not about the general translation of an OO interface
My problem actually is that I was using the response body before the callback
I'm facing following problem actually: I'm using Spring with jQuery. I have Controller: @Controller
This question is more about guidance than actually solving my problem: I need to
actually, problem solved. I made a mistake putting mysql_real_escape() for the post value, so
I'm having a problem similar to but not quite the same as one I've
NOTE : My problem is NOT that my links are not being replaced. But,

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.