Methods for generating WSDL ("Web Services Description Language")
documents to describe types and function entry points based on database
metadata are disclosed. Such a method may include resolving the endpoint
metadata by querying based on parameters about the request collected by
the HTTP stack. From the endpoint metadata, the list of entry points
which have been mapped may be collected. For each entry point, attributes
about the entry point may be collected, and metadata for the types of
parameters to the entry point may be looked up. A first collection of
unique XML schema namespaces may be created, with one entry corresponding
to each unique XML schema namespace for any arbitrary user-defined XML
Schema definitions required by a parameter to an entry point. A second
collection of unique XML schema namespaces may be created, with one entry
corresponding to each unique XML schema namespace for an entry point. The
wrapper elements for the WSDL document and any global XML schema
definitions may be emitted. The first collection of unique XML schema
namespaces may be iterated through, and the XML schema definitions may be
emitted. The second collection of unique XML schema namespaces may be
iterated through. For each entry point in the second collection, the XML
schema definition for the entry point may be emitted, including any XML
schema definitions for parameters to the entry point. After emitting all
of the XML schema definitions, the entry points may be iterated through,
and WSDL document definitions for messages, port types, and bindings for
each entry point may be emitted. After emitting all of the message
definitions, the WSDL document may be completed by emitting service entry
definitions for the endpoint.