Dear Christian,
Thanks for your kind reply. Since the issue still exists, I am providing more information about the issue, please find them below.
your example is running fine on my machine (no matter which value I choose for the status-only attribute).
I downloaded a fresh copy of basex and ran the request query that was in my previous email, yet facing the same issue. As you explained, I expected the response described below no matter which is the value for status-only attribute.
<http:response xmlns:http="http://expath.org/ns/http-client" status="404" message="Not Found"> <http:header name="Content-Length" value="48"/> <http:header name="Server" value="Jetty(6.1.26)"/> <http:body media-type="application/octet-stream"/> </http:response>
As I explained before, I am getting the above response when "status-only='true'", But when "status-only = 'false'", an exception (experr:HC0001) is thrown rather than getting the above response. Please kindly go through attached screen shots.
Is there any reason why you don't directly access your RESTXQ functions? I know too less about your architecture, but, as a general guideline, it's not recommended to perform http/restxq/rest calls on the same machine (i.e., localhost), as you might run into deadlock issues. In particular, this will happen if your query will be managed by the same database context. You won't encounter any issues, however, if you have completely separated BaseX instances for your query and your web services.
Actually, they are two separate applications in which one tests the another. They may/may not run in the same machine in the future. since it is in early development stage, we are in need to run both applications in the same machine. Thanks for your suggestion, we will maintain a separate BaseX instance from now. Just as a curiosity, it would be very helpful, if you could provide me an link/reference to know more about why
it's not recommended to perform http/restxq/rest calls on the same machine
?".
Thanks, Seenivasan
On 07/30/2012 07:29 PM, Christian Grün wrote:
Hi Seenivasan,
your example is running fine on my machine (no matter which value I choose for the status-only attribute).
Is there any reason why you don't directly access your RESTXQ functions? I know too less about your architecture, but, as a general guideline, it's not recommended to perform http/restxq/rest calls on the same machine (i.e., localhost), as you might run into deadlock issues. In particular, this will happen if your query will be managed by the same database context. You won't encounter any issues, however, if you have completely separated BaseX instances for your query and your web services.
Hope this helps, Christian ___________________________
Hi all,
I want to share my experience with HTTP module while posting to
restxq.
Consider this example,
import module namespace http='http://expath.org/ns/http-client'; let $req := <http:request method="GET" href="http://localhost:8984/restxq/example" status-only = "false" username = "admin" password = "admin" send-authorization="true"> </http:request>
let $resp := http:send-request($req) return $resp
run the same query with status-only="false" and status-only="true".
the first one(status-only="false") gives exception while the second one(status-only="true") returns proper response header. This is making difficult to handle the response of some requests which MAY contain body data. suppose we want to return the content of the document, if exists, as response body or a standard 410 status. The request should obviously contain status-only = "false".
we also tried handling response with the one below, but the issue does exists. rest:response <http:response status="410" reason="Gone"> </http:response> </rest:response>
I have tried with other http client like Firefox Poster plug-in and it is returning expected response. Is there anything wrong in the approach?
Thanks, Seenivasan _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk