Hello,

I'm fairly new to webservices and am trying to put together a simple
application. What I want to do is to be able to persist an object in
database (using hibernate), in a method that I will expose as a web service. 

So to do this, I have a Student POJO class (instances of which I want to
persist), and a StudentService class which has a method called addStudent
and takes in a Student object as a parameter. I deploy the Student and the
StudentService class. Then I have a client which calls the service.

To verify that my Student object was getting serialized <-> deserialized
properly, I reduced my addStudent method to the very minimum, so that when
it receives a Student all it does a simple .getFirstName() and returns it
with a "hello," prefixed to it. This works fine.

But, when I add my hibernate code inside the method to persist the Student
(which works fine when called without using the webservice), but everything
breaks with a InvocationTargetException when I inovke it through the
webservice. The .getCause() on the exception, tells me something is "null".
My guess is that I deployed the StudentService class on the Axis server, but
it does not know anything about the Hibernate session factories and all,
because I did not deploy anything about hibernate. 

I studied the Axis User Guide and understood from there that in case of my
own objects like the Student object, I need to define it in the deploy.wsdd
file in beanMapping element for it to be "recognized". I did that, and
that's why the .getFirstName() worked fine. My question is, what do I need
to do so that the web service also recognizes my hibernate code. Are there
any online tutorials that might help? I've tried to find one, but I
couldn't. 

Thanks.
-- 
View this message in context: 
http://www.nabble.com/How-to-make-a-web-service-method-%22know%22-all-of-the-classes-that-it-uses-tp16287763p16287763.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to