My webMethods Server 10.5 | My webMethods Server Webhelp | Administering My webMethods Server | System Administrator Functions | Working with the Common Directory Services API | Prerequisites | Initializing Common Directory Services
 
Initializing Common Directory Services
When the CDS API is accessed from within My webMethods Server (from a CAF application for example), or from Integration Server, CDS is already initialized and no further action is needed. If you want to use the CDS API from an external application or service that has access to My webMethods Server, the CDS API must be explicitly initialized from the external application or service.
You initialize Common Directory Services by invoking the com.webmethods.sc.mws.MWSLibrary.init() static method. The input parameters are expected as Java system properties and must describe a JDBC connection URL to a My webMethods Server database schema. Instead of using remote call backs to My webMethods Server, the CDS API connects to this schema and reads all configuration and principal information.
Here is sample code showing how to initialize CDS using the MWSLibrary class:
System.setProperty(MWSLibrary.SYSTEM_PROP_DB_DRIVER,
"com.wm.dd.jdbc.sqlserver.SQLServerDriver"); // JDBC Driver Class
System.setProperty(MWSLibrary.SYSTEM_PROP_DB_URL,
"jdbc:wm:sqlserver://localhost:1433;DatabaseName=webm82_dev");
    // JDBC Connection URL
System.setProperty(MWSLibrary.SYSTEM_PROP_DB_USER, "webm82_dev");
    // DB username
System.setProperty(MWSLibrary.SYSTEM_PROP_DB_PASSWORD, "password");
    // DB
password
MWSLibrary.init();