I would need to set an attribute value in the WSDL for a JAX-WS WebService. I found that this can be done using the @XmlAttribute annotation for a "public static final" field of a complex type, but how do I actually pass the value from my class to the WSDL? For example, I have a class that is used as an argument for a method:
@XmlType(name = "argument")
public class Argument {
@XmlAttribute
public static final int fixer = 7;
}
This would create the following WSDL:
<xs:attribute name="fixer" type="xs:int" use="required"/>
But what I need is:
<xs:attribute name="fixer" type="xs:int" use="required" fixed=7/>
How to accomplish this using JAX-WS annotation?
Any help would be appreciated!
EDIT: added 'final' modifier