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

Using only one method in session bean to create web service

Hi all,

I hhave a scenario where i am inserting and retrieving data from dict table using web service.

For this i have created a session bean and a wrapper class.

The session bean has two methods: insertRecords(), and viewRec().

so while creating a web service i need to include two methods.

I want to have only one method where i can pass a parameter as operation and if it is "I", then i can call the insert method and if it is "S" i can call view method.

I tried doing that bt i am stuck up with the return type.

Insert method has return type as array of wrapper class and

view method has wrapper class as return type ...

Is this scenario possible..??

or is there any other way to do this???

Plz let me knw..

Thankls n regards,


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2008 at 04:57 AM

    Hi Ankita,

    According to my understanding of your problem ,

    you can keep the return type of your wrapper method which is internally calling the view method as Array of Wrapper class objects.

    When you will call the view method according to the passed parameter and when it will return the wrapper class object then you can again create an Array of that wrapper class which will hold only 1 object and return it.

    And in case of insert method return type will be Array of Wrapper class, so by doing this you can use the same method with same return type.

    Hope this helps.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      You have to make sure that connection to the db is correct.

      Better to debug the application or you can write simple class, which writes log messages to some file.

      Place the log messages in methods and execute.

      You will come to where exactly the problem is coming.

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.