[MarkLogic Dev General] RE: Passing parameters to .xqy files
Justin.Makeig at marklogic.com
Thu Apr 16 07:10:08 PDT 2009
Your approach is sound. There are two ways to access MarkLogic Server from Java that people typically use: 1) web services over HTTP as you’ve described and 2) XCC. XCC is a Java (and .Net) library that allows you to open connections to MarkLogic and execute XQuery in much the same way as you’d use JDBC for a relational database. You can find the download and documentation for XCC on our developer site <http://developer.marklogic.com/download/#XCC>. If you choose to go the web service route, within your XQuery you can use the functions xdmp:get-request-field and xdmp:get-request-header to access the query parameters and HTTP headers respectively. You can find out more information about functions available for processing HTTP requests and responses in our developer documentation <http://developer.marklogic.com/pubs/4.0/apidocs/AppServerBuiltins.html>.
Mark Logic Corporation
999 Skyway Road
San Carlos, CA 94070
+1 650 655 2387 Phone
justin.makeig at marklogic.com<mailto:justin.makeig at marklogic.com>
This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation.
Don't miss the XML event of the year! Join us for the Mark Logic User Conference, May 12-14, in beautiful San Francisco. Hear from keynote speakers James Surowiecki, best-selling author of "The Wisdom of Crowds" and Whit Andrews, top analyst from Gartner. REGISTER NOW<http://www.regonline.com/ml09>.
From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of Runstein, Robert E. (Contr) (IS)
Sent: Thursday, April 16, 2009 6:43 AM
To: general at developer.marklogic.com
Subject: [MarkLogic Dev General] Passing parameters to .xqy files
I have a Tomcat application that needs pass search criteria to MarkLogic and return the results. What is the best way to handle this? I am considering putting all the logic to create the xquery and execute it in .xqy files. Tomcat would open a URL connection to MarkLogic and pass the search criteria in the query string and return the results in the HttpResponse. How do I get access to the HttpRequest parameters within a .xqy file. I'm very new to MarkLogic, so if this is totally the wrong approach, please advise a better way to do this.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the General