[Logo]
Forums Register Login
passing collection object as an argument to Web service
Hi,

I have to pass object of collection to web service method.I know that using collection is not a good solution but i have to pass this.
And my collection is of userdefined type like

public void processData(collection user){
//exposed as a web service method
}

Collection data = new HashMap();
data.put("data1", emp);

where emp is an Object of class Employee.

Can anyone explain me how to do this?I am using Axis web service
Hi!
Here are some suggestions, which I cannot guarantee will work since I haven't tried:
1. Create a custom class EmployeeEntry which contains the key and the associated instance of Employee.
Have your web service method accept an array of EmployeeEntry instances:

2. Create a custom class that wraps the collection.

Then in your web service method, you take an instance of the wrapper class as parameter:


Personally, I would try to go for alternative one.
Best wishes!
Thanks for the reply
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 18, 2017 20:25:27.