Sunday, 1 September 2013

Change WSDL xsd:complexType name with Apache CXF

Change WSDL xsd:complexType name with Apache CXF

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!

No comments:

Post a Comment