- This topic has 6 replies, 2 voices, and was last updated 18 years, 6 months ago by
Brian Fernandes.
-
AuthorPosts
-
saifMemberHi 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.December 12, 2006 at 12:43 pm #263332
saifMemberPlz 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.December 12, 2006 at 3:23 pm #263337
Brian FernandesModeratorSaif,
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>:<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)
December 13, 2006 at 3:01 am #263367
saifMemberthank 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.
December 13, 2006 at 2:32 pm #263409
Brian FernandesModeratorQuick 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.
December 14, 2006 at 5:54 am #263436
saifMemberthank 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.December 14, 2006 at 8:00 am #263438
Brian FernandesModeratorSaif,
I’m glad it’s working. Thanks for reporting back. -
AuthorPosts