Reputation: 655
I am trying to see whether MarkLogic Java API can be used to create a content database and REST Server? I went through te Java API but I dont see any reference.
Is it possible to create a REST Server through MarkLogic Java API?
I appreciate any links or pointers regarding this.
Upvotes: 1
Views: 160
Reputation: 2475
No, that's beyond the scope of the Java Client API. The Java Client API must connect to a REST Server after it's already created. You can, however, use the /rest-apis service on port 8002 via your favorite generic REST client API for Java. To see an example of how to do this with Apache HttpClient, see Bootstrapper.java. You can use it directly like the unit tests setup util TestServerBootstrapper.java does with this code:
Bootstrapper.main(new String[] {
"-configuser", username,
"-configpassword", password,
"-confighost", host,
"-restserver", "java-unittest",
"-restport", ""+port,
"-restdb", "java-unittest"});
Upvotes: 2