Skip to Content
author's profile photo Former Member
Former Member

WebService method return value as Hashtable

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 06:36 AM

    Hi Bobby,

    Check this Arraylist in Web Service

    Regards,ANilkumar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 08:58 AM

    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,

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.