1

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.

2
  • Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. Commented Sep 14, 2017 at 18:17
  • @JFPicard I want to create the Marklogic Content DB, REST Server using JAVA Client API of marklogic. I don't have any reference to create Content DB and REST Server on the fly using JAVA Client API. Is there any document available for the above stuff. Right now we are using curl to create the above stuff but i want it to be controlled through the java API provided by Marklogic. Commented Sep 14, 2017 at 19:01

1 Answer 1

2

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"});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.