When however running from within a Java program (with a valid API key of course), it went fine.
For development of new queries, that is however not a good option.
I now however discovered the native BaseX GUI (wasn't aware of it) and there, the query runs just fine. So for development and testing, that will be the first choice from now on.
Just as a side question: any idea why the query does not run when using the GUI within Apache Tomcat?
Hi Jozef,
I tried the following query…
http:send-request(
<http:request method='get'
<http:header name="Ocp-Apim-Subscription-Key"
value="abcdef0123456789abcdef0123456789"/>
</http:request>)
…and it returned the error message 'Access denied due to invalid
subscription key. Make sure to provide a valid key for an active
subscription.'.
I guess that’s expected because the key is not valid anymore. Do you
get the same response as above with wrong keys, though, or do you get
"Connection failed"? Is the connection failure accommodated by an
error code, an HTTP response header or anything else?
Feel free to provide us with more information if there’s any chance to
reproduce the problem. Next, feel free to share the verbose curl
output for the successful request with us (-v).
Best
Christian
>
Dear colleagues,
We are using XQuery with BaseX for the development of hundreds of validation rules for CDISC Standards ("Open Rules for CDISC Standards").
For some of these rules we need a lookup using a RESTful web server located at CDISC. Until now, that server used basic authentication until now, but they are moving to using an Azure API key.
For the new mechanism, the curl request is:
-H "Accept: application/json" \
-H "Ocp-Apim-Subscription-Key: abcdef0123456789abcdef0123456789"
let $response := http:send-request(
<http:header name="Ocp-Apim-Subscription-Key" value="{$apikey}"/>
</http:request>)
and:
let $response := http:send-request(
<http:request method='get'>
<http:header name="Ocp-Apim-Subscription-Key" value="{$apikey}"/>
where $apikey is my personal key, which works when working with curl or in a Java program.
but I get a "Connection failed".
From a few experiments, it looks as the server is reached, but then refuses to do something with the request. I cannot see however what the details of the failure is.
Any idea what I am doing wrong?
Many thanks in advance,
Jozef Aerts
XML4Pharma