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 objec开发者_运维百科ts. 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.
I think you need to look at the POJO guide
精彩评论