[
http://issues.apache.org/jira/browse/AXIS-849?page=comments#action_12312599 ]
Peter Wisnovsky commented on AXIS-849:
--------------------------------------
Hmm...my schema is huge at this point, and is spread over 8 files. But I can
give you:
<xs:complexType name="ParentDateRangeRuleType" final="true">
<xs:complexContent>
<xs:extension base="pvParametric:BusinessRuleType">
<xs:attribute name="overrideable" type="xs:boolean" fixed="true"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
This generates
private boolean overrideable; // attribute
public BusinessRuleType() {
}
public BusinessRuleType(
boolean overrideable) {
this.overrideable = overrideable;
}
/**
* Gets the overrideable value for this BusinessRuleType.
*
* @return overrideable
*/
public boolean isOverrideable() {
return overrideable;
}
/**
* Sets the overrideable value for this BusinessRuleType.
*
* @param overrideable
*/
public void setOverrideable(boolean overrideable) {
this.overrideable = overrideable;
}
I would also observe that "use=prohibited" has no effect. Now I'm not sure what
effect it should have, though if I have a supertype of the one above of the
form
<xs:complexType name="BusinessRuleType" abstract="true">
<xs:attribute name="overrideable" type="xs:boolean" use="prohibited"/>
</xs:complexType>
Then it might make sense to emit
public abstract setOverrideable(boolean);
public abstract boolean isOverrideable();
Its certainly handy to be able to express this pattern in the generated classes.
Also I notice that AXIS1264 is a dup of this.
Thanks for looking at this,
Peter
> WSDL2Java ignores fixed elements/attributes
> -------------------------------------------
>
> Key: AXIS-849
> URL: http://issues.apache.org/jira/browse/AXIS-849
> Project: Axis
> Type: Bug
> Components: WSDL processing
> Versions: 1.0-rc2
> Environment: Operating System: Other
> Platform: Other
> Reporter: Nikolay Metchev
> Assignee: Axis Developers Mailing List
>
> If in the types section of a wsdl document you specify a type which has an
> attribute/element that has a fixed value. The client code that gets generated
> does not enforce that by disallowing the setting of that attribute externally.
> On a similar note if a type has an element and an attribute with the same
> name
> then the generated code does not compile.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira