Bob,
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>.

Justin

Justin Makeig
Product Manager
Mark Logic Corporation
999 Skyway Road
Suite 200
San Carlos, CA 94070
+1 650 655 2387 Phone
[email protected]<mailto:[email protected]>
www.marklogic.com<http://www.marklogic.com/> 
<http://www.marklogic.com/><http://www.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: [email protected] 
[mailto:[email protected]] On Behalf Of Runstein, Robert 
E. (Contr) (IS)
Sent: Thursday, April 16, 2009 6:43 AM
To: [email protected]
Subject: [MarkLogic Dev General] Passing parameters to .xqy files


HI,

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.

Best Wishes,

Bob Runstein
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to