File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic

Problem in returning Complex user defined Objects within Hashmap

 
Jey
Greenhorn
Posts: 3
  • 0
  • 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
 
Arpan Raj
Greenhorn
Posts: 15
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am having the same issue did you find any solution for the same?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • 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
  • 0
  • 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
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • 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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic