server side restxq calls
Tuesday, 10 December 2013 · 2 messages
EF
Eckey, Florian10 Dec 2013 13:59 #
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"/>). 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,
FlorianCG
Christian Grün10 Dec 2013 14:04 #
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,
ChristianQuoted text · Florian · 50 lines
On Tue, Dec 10, 2013 at 1:59 PM, Eckey, Florian <Florian.Eckey at 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"/>). > > 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 at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
Written for BaseX 7.7. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery