facebook

[Closed] Error when returning an ArrayList

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #263317 Reply

    saif
    Member

    Hi every body,
    In my web service i have a method that return an ArrayList.When i invoked it from my client i had an Exception relevent to this ArrayList Type. I know that when we don’t use simple type we should add some thing but i don’t know what is it.
    thank you for any help.

    #263332 Reply

    saif
    Member

    Plz I need your help. what can i do to resolve this probleme?
    i’m new in developping web services and it’s my first web service project using myeclipse.
    i didn’t find what to do to return a complex type as ArrayList or any object in general.
    thank you in advance.

    #263337 Reply

    Brian Fernandes
    Moderator

    Saif,

    I need a few more details. What exception do you see when you run the client?
    Are you able to call other methods which do not return an ArrayList but something simpler like a String or an Integer?

    Finally, how did you develop your webservice? Did you use a Top down approach (starting from WSDL) or are you using a bottom up approach (using java classes directly)?
    What server did you deploy your web service to and what happens when you go to this address – http://<server&gt;:<port>/<webapplication>/services)

    Could you paste the WSDL file here? (If you used the bottom up approach, you can get this file at the above address and click the WSDL link next to your service)

    #263367 Reply

    saif
    Member

    thank you very much for your answer.
    i had found the probleme yesterday. My mistake was that i used Arraylist whithout specifying th Class. i.e : I had declared a variable as ArrayList and not as ArrayList<String>.
    But i had a probleme when i tried to return an ArrayList<Conjugation>.Conjugation is a Class that i use in my project. I have gotten the following exception :

    Exception in thread “main” org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Couldn’t instantiate class. com.enit.service.Conjugaison

    thank you for any help.

    #263409 Reply

    Brian Fernandes
    Moderator

    Quick question, do you have a default / no argument constructor for the Conjugaison class? I believe you need one so that XFire’s Aegis binding can instantiate that class.

    #263436 Reply

    saif
    Member

    thank your very much,
    i added the default constructor and it worked fine. but the Xfire asked me to add setters of all the properties of my class.i don’t need them but i have added them to run my web service.
    thank you again.

    #263438 Reply

    Brian Fernandes
    Moderator

    Saif,
    I’m glad it’s working. Thanks for reporting back.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: [Closed] Error when returning an ArrayList

You must be logged in to post in the forum log in