This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
    Bookmark Topic Watch Topic
  • New Topic

Problem in returning Complex user defined Objects within Hashmap  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

I wrote a simple web service which returns Complex user defined objects like CustomerBean/UserBean within a Hash Map.

Here is the webservice:

public class MyWebservice{

public HashMap getData(HashMap requestData) {
//goes and gets the data from business service component and
//gets business objects and it is stored into response HashMap.
//example;
HashMap responseData = new HashMap();
responseData.put("customer",new CustomerBean());
return response;
}

public class CustomerBean implements java.io.Serializable {
// has attributes and its getter and setter method...
}

Web service is deployed in IBM Websphere Application Server 6 environment.

When client calls this web service, I am getting an exception at the server:
"Serialization cannot occur for CustomerBean"

Could you please explain what i am doing wrong. How to fix this issue...

Thanks
Jey
 
Greenhorn
Posts: 15
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am having the same issue did you find any solution for the same?
 
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Report post to moderator
Kindly provide some details.

Is this a SOAP service? Which toolkit? What is the client? Operating system?

Did you create the service using an IDE? Which one?

etc etc

Bill
 
Arpan Raj
Greenhorn
Posts: 15
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thanks for replying
I have posted more detailed question here. http://www.coderanch.com/t/546639/Web-Services/java/we-support-Map-HashMap-webservice
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi!
Since you have posted a more detailed question elsewhere, I lock this thread.
Best regards!
 
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!