Hi Thomas, Haug, Thomas wrote: > Hi Chinthaka, > > Thank you for the quick answer. > So if I got it right: the Axis2 framework inspects the service class (via > reflection?), if the service class provides a > setOperationContext(OperationContext opContext) method. Are there any other > operation which can be 'magically' called ? > >>From a design perspective this looks a bit awkward, because there is no >>interface which mandates that my service class has to implement the >>corresponding method(s). Instead the contract between my class and Axis2 is >>done implicitly and I have to mention it at least at 'JavaDoc level' >>otherwise nobody of my developers whould know. I would rather like to see an >>approach similar as in Axis 1 (which is similar to the CORBA Current object >>approach).But this is only my opinion ... ;-)
Good point. Let me ask explain a bit on this and ask a question from you. I'd like to see your approach to this problem. We didn't want to put any restriction on a user who wanna write a simple java class and expose that as a web service. Thats been the case so far. I hope you can understand that it will make the most common and simple case simple. And I don't see a single reason behind the service impl being dependent on the web services engine being used. So thats why we didn't wanna define a contract for the service implementor to implement. But at the same time, there are situations where the service author needs to get some information from the framework. That needs the framework requires a method in the service to invoke. Our approach to this was to use IOC concepts as used heavily in Geronimo. So thats why through a dependency manager, we have a mechanism to inject operation context to the service implementation class. IMO, this is the ideal compromise we can get to make the simple case simple and get to other cases also work. If you have any other approach for this problem, we are happy to hear that. Note : this dependency injection will happen iff, you use an in-built message receiver that comes with Axis2. That won't work with the generated or custom message receivers. > > Nevertheless, thanks for the hint. At least I am now able to get the > SOAPHeader. np. -- Chinthaka
signature.asc
Description: OpenPGP digital signature
