Debugging MarkLogic AppServer xquery code

I have Oxygen setup now so I can debug on MarkLogic server, but it requires a local xquery file. This is fine for some things, but I'd like to debug some queries that are run as part of the AppServer technology. These need to be run from within marklogic so they have access to functions like xdmp:get-request-field() Any suggestions on how to debug a xquery the resides on marklogic being invoked as an app request ? Thanks for any ideas. ---------------------------------------- David A. Lee Senior Principal Software Engineer Epocrates, Inc. dlee@epocrates.com <mailto:dlee@epocrates.com> 812-482-5224

Hello, You can execute a local XQuery that invokes an XQuery from the MarkLogic server and the XQuery is executed on the server but debugging does not step into the XQuery from the server. For example the following local XQuery invokes an XQuery from the server: xdmp:invoke("/movies.xquery") We will contact the MarkLogic developers to find if they plan to add this feature on the server. Regards, Sorin Lee, David wrote:
I have Oxygen setup now so I can debug on MarkLogic server, but it requires a local xquery file.
This is fine for some things, but I’d like to debug some queries that are run as part of the AppServer technology.
These need to be run from within marklogic so they have access to functions like
xdmp:get-request-field()
Any suggestions on how to debug a xquery the resides on marklogic being invoked as an app request ?
Thanks for any ideas.

Thank you, that would be a very useful feature. Another useful feature would be to be able to either connect to a running XQuery from the APP Server, or to simulate the request arguements. For example if I have a xquery running in mark logic app server (not the XDBC server) And I call it via a URL from a brower like http://marklogic:1234/myquery.xquery?arg=value Inside that query I can use let $arg := xdmp:get-request-field("value") Your suggestion of xdmp:invoke() I dont think simulates the request fields passed in from an HTTP invocation of an xquery running in the App server component of markLogic. An idea I had is to try to make a very thin wrapper (that hopefully is easy enough to be bug free :) that gets the request fields, then turn that into an invoke on a xquery which expects external parameters instead of request fields. Then I might be able to debug that xquery in Oxygen using parameters. -----Original Message----- From: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] On Behalf Of Sorin Ristache Sent: Wednesday, November 11, 2009 9:05 AM To: oXygen-user@oxygenxml.com Subject: Re: [oXygen-user] Debugging MarkLogic AppServer xquery code Hello, You can execute a local XQuery that invokes an XQuery from the MarkLogic server and the XQuery is executed on the server but debugging does not step into the XQuery from the server. For example the following local XQuery invokes an XQuery from the server: xdmp:invoke("/movies.xquery") We will contact the MarkLogic developers to find if they plan to add this feature on the server. Regards, Sorin Lee, David wrote:
I have Oxygen setup now so I can debug on MarkLogic server, but it requires a local xquery file.
This is fine for some things, but I'd like to debug some queries that are run as part of the AppServer technology.
These need to be run from within marklogic so they have access to functions like
xdmp:get-request-field()
Any suggestions on how to debug a xquery the resides on marklogic
being
invoked as an app request ?
Thanks for any ideas.
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

That is not possible if the XQuery was not started in a debugging context on the MarkLogic server. The Oxygen XQuery debugger can run an XQuery only if the XQuery is started in debug mode on the MarkLogic server and only if that is an XDMP server. In a future version we will improve the XQuery debugger to step into an XQuery from the server that is invoked with xdmp:invoke() from a local XQuery file. Regards, Sorin Lee, David wrote:
Thank you, that would be a very useful feature. Another useful feature would be to be able to either connect to a running XQuery from the APP Server, or to simulate the request arguements. For example if I have a xquery running in mark logic app server (not the XDBC server)
And I call it via a URL from a brower like http://marklogic:1234/myquery.xquery?arg=value
Inside that query I can use
let $arg := xdmp:get-request-field("value")
Your suggestion of xdmp:invoke() I dont think simulates the request fields passed in from an HTTP invocation of an xquery running in the App server component of markLogic.
participants (2)
-
Lee, David
-
Sorin Ristache