Hi,
during implementing my website based on BaseX with restxq, I run into a problem. In BaseX it is only possible to execute either updating or non-updating xquery expressions in a function. So if I want to mix updating with non-updating expressions I have to execute a restxq call (updating) which forwards to another restxq call (non-updating). I know the possibility of using db:output("some non-updating expression"), but I guess it is not the right way if I only use updating-functions with db:output(...). Like:
declare updating function ns:foo(...) { db:output("some code") }
So my idea is to execute server side restxq calls, like: restxq:call("user/1"), which delivers the output of the function behind. I tried out going the external way with http:send-request(<http:request method='get' href="https://localhost:8443/user/1%22/%3E). But I get problems with the SSL connection. If I open another non-SSL basex server a different port it is not possible to execute restxq calls as well, because of the jetty security module I use.
So are there any clever ideas either to mix updating with non-updating functions (and not abuse transaction security) or do server side restxq calls?
Best regards,
Florian
Hi Florian,
using http:send-request for server-side calls is dangerous indeed. Did you have a look at the rest:forward construct?..
http://docs.basex.org/wiki/RESTXQ#Forwards_and_Redirects
Best, Christian ___________________________
On Tue, Dec 10, 2013 at 1:59 PM, Eckey, Florian Florian.Eckey@adesso.de wrote:
Hi,
during implementing my website based on BaseX with restxq, I run into a problem. In BaseX it is only possible to execute either updating or non-updating xquery expressions in a function. So if I want to mix updating with non-updating expressions I have to execute a restxq call (updating) which forwards to another restxq call (non-updating). I know the possibility of using db:output(“some non-updating expression”), but I guess it is not the right way if I only use updating-functions with db:output(…). Like:
declare updating function ns:foo(…) { db:output(“some code”) }
So my idea is to execute server side restxq calls, like: restxq:call(“user/1”), which delivers the output of the function behind. I tried out going the external way with
http:send-request(<http:request method='get' href="https://localhost:8443/user/1%22/%3E).
But I get problems with the SSL connection. If I open another non-SSL basex server a different port it is not possible to execute restxq calls as well, because of the jetty security module I use.
So are there any clever ideas either to mix updating with non-updating functions (and not abuse transaction security) or do server side restxq calls?
Best regards,
Florian
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de