enunciate

articulate your web api.

C# Module

The C# module generates C# client code for accessing the SOAP endpoints and makes an attempt at compiling the code in a .NET assembly. If the the compile attempt is to be successful, then you must have a C# compiler available on your system path, or specify a "compileExecutable" attribute in the Enunciate configuration file. If the compile attempt fails, only the C# source code will be made available as a client artifact.

The order of the C# deployment module is 0, as it doesn't depend on any artifacts exported by any other module.

Configuration

The C# module is configured with the "csharp" element under the "modules" element of the enunciate configuration file. It supports the following attributes:

  • The "label" attribute is the label for the C# API. This is the name by which the files will be identified, producing [label].cs and [label].dll. By default the label is the same as the Enunciate project label. For a more custom configuration of the generated file names, use the "bundleFileName", "DLLFileName", "docXmlFileName", and "sourceFileName" attributes.
  • The "compileExecutable" attribute is the executable for invoking the C# compiler. If not supplied, an attempt will be made to find a C# compiler on the system path. If the attempt fails, the C# code will not be compiled (but the source code will still be made available as a download artifact).
  • The "compileCommand" is a Java format string that represents the full command that is used to invoke the C# compiler. The string will be formatted with the following arguments: compile executable, assembly path, doc xml path, source doc path. The default value is "%s /target:library /out:%s /r:System.Web.Services /doc:%s %s"
  • The "singleFilePerClass" allows you to specify that Enunciate should generate a file for each C# class. By default (false), Enunciate puts all C# classes into a single file.

The "package-conversions" element

The "package-conversions" subelement of the "csharp" element is used to map packages from the original API packages to C# namespaces. This element supports an arbitrary number of "convert" child elements that are used to specify the conversions. These "convert" elements support the following attributes:

  • The "from" attribute specifies the package that is to be converted. This package will match all classes in the package as well as any subpackages of the package. This means that if "org.enunciate" were specified, it would match "org.enunciate", "org.enunciate.api", and "org.enunciate.api.impl".
  • The "to" attribute specifies what the package is to be converted to. Only the part of the package that matches the "from" attribute will be converted.
Flattr this