cancel
Showing results for 
Search instead for 
Did you mean: 

WebService method return value as Hashtable

Former Member
0 Kudos

Hi,

I have an ejb module. From that one of the method is returning Hashtable object. But when I am creating webservice for that ejb module it is not accepting hashtable as return value. To return key value pair which java class/interface I can use.

Thanks

Bobby M

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hai ,

You can return array list by providing a bean.

Public Class Pair implements Serializable{

String Key;

String Value;

//Setters and Getters

}

//webservice method

Public ArrayList SomeX(){

ArrayList al=new ArrayList();

for(your data condition){

Pair p=new Pair ();

p.setKey(key);

p.setValue(value);

al.add(p);

}

return al;

}

other wise you can return array of pair objects.

Regards,

Former Member
0 Kudos

Hi Bobby,

Check this

Regards,ANilkumar