Skip to main content

Developing with XCC

ContentFetcher

This program fetches a document from MarkLogic Server and serializes its contents. You can serialize the contents to the standard output (display it on the screen) or to a file using the -o option. The following is a sample command to run the ModuleRunner class:

java -classpath "XCC_HOME/lib/xcc.jar:XCC_HOME/lib/xccexamples.jar"
     com.marklogic.xcc.examples.ContentFetcher 
     xcc://username:password@localhost:8021 
     /mydocs/hello.xml -o myHelloFile.xml

This sends the contents of the document at /mydocs/hello.xml to the file myHelloFile.xml (in the same directory in which the command is run). It connects to the default database of the XDBC Server listening on port 8021 of the local machine, using the credentials username and password to authenticate the connection.