The MDEX Web service, which is included as part of this release, allows you to use XQuery with the MDEX Engine without writing custom Web services.
The MDEX Web service consists of an mdex.xq main module and mdex.wsdl file. These files implement a service that provides a SOAP wrapper for the MAX API.
The MDEX Web service is a WS-I compliant, WSDL/SOAP 1.x Web service. Along with any other Web services included in the installation, it is loaded automatically upon MDEX Engine startup, unless the engine is started with the --disable_web_services flag.
Bulk export is not supported in this release of the MDEX Web service.
The MDEX Web service is not meant as a Web service replacement to the Presentation API, but rather as a data service similar to something that a relational database management system might provide. In an RDBMS scenario, SQL input transported via ODBC or JDBC returns tabular results. Similarly, in an MDEX scenario, XQuery input transported via the MDEX Web service returns XML results.
The MDEX Web service accepts an XQuery main module as its request argument, and returns the result of evaluating that module in the MDEX. The main module is a string that can be constructed programatically in your application. The module contained in each request is compiled in the MDEX Engine on the fly. Such main modules may call library modules that have been loaded into the MDEX Engine, including custom library modules.
If your XQuery logic is very simple, your application has modest performance requirements, or you need complex application-tier logic to generate your XQuery code on the fly, you will benefit from the MDEX Web service. In particular, if your XQuery logic consists simply of MDEX API through XQuery (or MAX) calls, the MDEX Web service has an important advantage: the WSDL for it will allow stub generators to provide you with bindings for all of the MAX return types. In general, generated stubs will return results in this form whenever the query’s return type is a MAX return type. When you run XQuery code that does not return MAX types, or embeds them in other elements, the generated stubs will provide you with an XML DOM tree, which you will have to traverse to obtain the result data.
The MDEX Web service is useful during XQuery development. It provides a convenient way to try out an ad hoc XQuery code fragment against the MDEX Engine, including ad hoc calls to library modules that you have written earlier. A convenient way to develop XQuery applications is to start with simple MDEX Web service calls that you gradually evolve by factoring out function declarations and moving them into library module files loaded into the MDEX Engine. In this scenario, at any point in time your well-tested and stable code lives in library module files, and your new and experimental function declarations and query body are sent to the MDEX Engine using the MDEX Web service. You may then choose to move the library module to a file loaded into the MDEX Engine as well, completing the transition to a custom Web service.