Reputation: 95
I have a integer field in a class which I have made private and no setter method is provided but when I generate the client with WSDL2Java, the generated class has a setter method.
Why is it so?
I am using Apache Axis 2.
I am putting the code for more explanation
public class MyClass {
private int id;
public int getId() {
return id;
}
}
So what should I do to hide the setter method when client is generated.
Upvotes: 0
Views: 1786
Reputation: 1238
When you creating a web service using a POJO it generates a wsdl file.
What WSDL2java tool uses is that generated wsdl file. But that does not have any idea of the original POJO you use to generate the wsdl. Currently there is no way in Axis2 to generate only the getter methods of the bean classes.
Upvotes: 2