How to tell axis2 to use an existing object as a service?

Posted by Christian Hausknecht on Stack Overflow See other posts from Stack Overflow or by Christian Hausknecht
Published on 2010-04-15T09:27:03Z Indexed on 2010/04/15 9:33 UTC
Read the original article Hit count: 311

Filed under:
|
|
|
|

I am trying to expose some methods of a running application as a webservice. The core idea is to use an embedded web-server and send the soap messages to the apache axis2 framework in order to invoke the services.

The problem is, that axis2's createService methods only accept Classes as parameter, not existing objects. So I believe that axis2 itself creates an object of the service class and then uses it to call methods when an external service call arrives.

But I need to pass an existing object for being used as a service, because I need to call methods of other objects of the running application within the service methods. So the "standard" way that axis2 creates a new instance of the service class and calls then its methods is obviously no sulution for me.

So is there a way to realize this?

Or is there another solution? Perhaps you can pass objects later on to the allready created service object by axis2?

If there is another solution without axis2 I might consider that one. Basically I am only interested in exposing some functionality of a runnning application as a webservice.

© Stack Overflow or respective owner

Related posts about axis2

Related posts about java