I use Apache CXF to publish a webservice, generating the WSDL "on-the-fly". This works great, but I would like to change the naming convention of the generated types. As the service clients (C#) generate code based on the WSDL, the default xsd:complexType naming results in type names starting with lower-case letters.
Here is an excerpt from the generated WSDL:
<xs:complexType name="protocolItem">
<xs:sequence>
<xs:element minOccurs="0" name="data" type="tns:protocolItemData"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="elements" nillable="true" type="tns:protocolElement"/>
<xs:element minOccurs="0" name="meta" type="tns:protocolItemMeta"/>
</xs:sequence>
</xs:complexType>
This is the Java code that results in the above WSDL fragment:
@RooJavaBean
public class ProtocolItem {
private ProtocolItemData data;
private ProtocolItemMeta meta;
private List<ProtocolElement> elements;
}
How can I change the generated WSDL to use something like <xs:complexType name="ProtocolItem">
?
Hopefully I am not missing a obvious annotation... Thanks!
EDIT: thanks for the first answer! So there is a way to do this "per class" - can I configure the CXF naming conventions? Would be nice if I did not need to annotate all classes.
Try this:
@XmlType(name="ProtocolItem")
public class ProtocolItem {
...
}
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With