Reputation: 4342
the question is quite simple so I hope I would be lucky to be clear enough to avoid creating code sample for it. We are using Axis2 (1.5.1 to be precise) which is to create Java client code and server stubs via wsdl2java, using our hand-crafted WSDL/XSD files. The service is generated in document-style mode, and we use ADB beans serialization stack.
Our new webservice has some common attributes in all methods that we are to create. Say, each of requests is to be marked with some accessToken, otherPartyID and other similar properties.
I was able to employ inheritance in schemas, so Request/Response types do extend common complexType and I don't have to repeat myself while creating schemas/WSDL for the webservice. But, when I try to code up the implementation, I (to my utter frustration) see that all codegenerated Request/Response objects are inheriting java.lang.Object and there's no common superclass with the common properties.
It would be quite nice to have such a class, so that code which treats those common properties stays generic and I don't have to use reflection and other dirty tricks to avoid monkey coding.
My current suspicion is that AXIS does not support inheritance across method Request/Response types, while it supports it for parameter types. Please share your experiences on this matter.
If you have any definite/precise answer with a link to documentation/sources of AXIS this will be just great.
Thanks in advance, Anton
Upvotes: 0
Views: 410
Reputation: 54094
This is not a direct answer to your question but what you are doing is wrong.
Inheritance is an Object-Oriented term and you shouldn't be deploying web services that capture OO specific mechanisms. This is against the concept of Service Oriented approach.
So in case your suspicion turns out correct this is not a problem in Axis but your design.
Anyway I would suggest asking this in the Axis2 support directly.
Upvotes: 1