aspose file tools*
The moose likes Web Services and the fly likes Problem in returning Complex user defined Objects within Hashmap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Reply locked New topic
Author

Problem in returning Complex user defined Objects within Hashmap

Jey
Greenhorn

Joined: Oct 15, 2004
Posts: 3
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

Joined: Apr 22, 2010
Posts: 15

I am having the same issue did you find any solution for the same?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
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


Java Resources at www.wbrogden.com
Arpan Raj
Greenhorn

Joined: Apr 22, 2010
Posts: 15

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

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Since you have posted a more detailed question elsewhere, I lock this thread.
Best regards!


My free books and tutorials: http://www.slideshare.net/krizsan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in returning Complex user defined Objects within Hashmap
 
Similar Threads
Would a HashSet be a way to solve this problem?
Problem in return Collection in Websphere Webservice
Sample Questions for 288 - Need answers
WebService for JPA Domain model dilemma
Getting exception serialization error: java.lang. NullPointerException