I am playing around with Webservices and Apache CXF.
The framework does pretty much everything by itself which is nice. I did not quite get behind the mechanics of the automatic marshalling process.
It appears, that by default the framework scans the data classes to be shipped over the network to find setter and getter methods and those are the ones it will include in the marshalling process. This is not really what I want though. I would rather like the properties itself to be read.
I have found this to be working:
Now, what I want is only to ship the personID property. This one does not have a setter, as it should be set upon creating the Person instance. the XmlElement annotation does just what I want. It reads the property w/o using getters or setters. Perfect.
What I don't want though is the framework to include the name property in the webservice, which it does since there are setters and getters available.
I suspect that there is a simple xml configuration that would do just what i want. Maybe somebody knows.
This is what my beans.xml looks like now:
JDBCSupport - An easy to use, light-weight JDBC framework -
posted 4 years ago
The easiest method is to stick an @XmlTransient annotation on the name field. This is a JAXB thing, not really a CXF thing.