Modeling

Start with a brand new model / project, with webservice - cxf selected as an option. If using an existing project or model, you will need at least the common, webservice, and xml profiles. Run the project first against a new empty model, to validate the starting project configuration, download all dependencies, and verify that the new build completes successfully.

Classes and Stereotypes

Model your service as a class with <<WebService>> and/or operations with <<WebServiceOperation>>. Service operations may have complex parameters with multiplicity *. Model the complex parameters as <<ValueObject>>. Label the packages containing services, valueobjects, and exceptions with <<XmlSchema>>. This creates an xsd file which can be referenced by the wsdl file(s). Service operations may throw exceptions. Model the exceptions as <<ApplicationException>><<WebFault>>. If you use <<WebFault>> without declaring the exception thrown by the service, you will get an error

Example

Here's a very simple example showing the package/class hierarchy:

images/cxf-model.gif

With the class diagram:

images/cxf-diagram.gif

XML Validations

XML Schema validations of incoming XML using standard XML schema restrictions is available through the <<Validation>> stereotype. These are the standard facet restrictions as defined in the W3C XML Schema Document http://www.w3.org/TR/xmlschema-2/#rf-facets. Various validations apply to different datatypes, i.e. The validation facets include:

Next

We'll look more closely at the generated code and code to be implemented. Output Projects section.