From: Wolfgang M. <wol...@ex...> - 2004-05-13 10:20:55
|
Sorry for the late response. I still had your message in the queue. Current= ly,=20 passing request objects to a remote server is not possible. The request=20 object is set through XQueryContext.declareVariable(). However, this method= =20 only works for XMLRPC supported types. We have to either allow arbitrary serializable objects to be passed to the= =20 XMLRPC query method, or define a special struct for the request, response a= nd=20 session objects. I guess, supporting serializable would be the better choic= e. Wolfgang On Thursday 13 May 2004 11:59, Pierre-Yves Vitr=E9 wrote: > Hi > > I have suggest the same problem few days ago, but I don't have response. > > Actually I use my .xq file directly in exist webapp and it work fine. > > I suggest you to put your xquery file into the exist/webapp/xquery > directory and try to call > http://localhost:8080/exist/xquery/test.xq?param=3Dtoto > > If it's working, I think that we have the same problem, but I don't know > how to resolve it. > > Regards, > > Pierre-Yves Vitr=E9 > > > > -----Message d'origine----- > De : exi...@li... > [mailto:exi...@li...]De la part de Philippe > Guillard > Envoy=E9 : jeudi 13 mai 2004 11:33 > =C0 : exist-open > Objet : [Exist-open] request:request-parameter() in XQuery file > > > Hi all, > I have trouble using HTTP Request Functions > (http://exist-db.org/xquery/request). I need to get request-parameters > from outside my .xq file used in cocoon. > Can anybody point me to some simple sample or tell me what is wrong > there? > > Regards, > > Phil > > test.xq > ------- > xquery version "1.0"; > declare namespace xmldb=3D"http://exist-db.org/xquery/xmldb"; > declare namespace request=3D"http://exist-db.org/xquery/request"; > let $param_value :=3D request:request-parameter("param", "") return > <param_value>{$param_value}</param_value> > > > pipeline > -------- > <map:match pattern=3D"test.xq"> > <map:generate src=3D"test.xq" type=3D"xquery"> > <map:parameter name=3D"collection" > value=3D"xmldb:exist://localhost:8080/exist/xmlrpc/db"/> > <map:parameter name=3D"user" value=3D"admin"/> > <map:parameter name=3D"password" value=3D""/> > <map:parameter name=3D"use-request-parameters" value=3D"true"/> > </map:generate> > <map:serialize type=3D"xml"/> > </map:match> > > lauched URI > ---------- > test.xq?param=3Dtoto > > error > ----- > XMLDBException occurred: org.exist.EXistException: null > java.lang.NullPointerException at > org.exist.xquery.functions.request.RequestURI.eval(RequestURI.java:68) > at |