I found Brazil while I was looking for a lightweight proxy server which could be extended to perform some gateway functions related to URL addressability. The problem is that technologies such as XSLT and XQuery can only retrieve web resources that are URL-addressable and retrieved using a simple HTTP GET. They cannot use HTTP POST and, by implication, web services. Furthermore, there is no way to add headers to GET requests. This rules out the various HTTP authentication schemes. Even if headers were allowed, few URI resolvers will go through, say, the basic HTTP authentication handshake sequence. The problem only worsens for higher-level protocols like SSL, WS-Security, etc.
There a number of approaches to solving this problem:
- Write custom code that accesses the web resource and then feeds it to the XSLT/XQuery processor.
- Write a custom URI resolver that accesses the web resource.
- Write extension functions (or elements) for the query processor.
- Introduce a gateway into the process converts simple GETs into the required requests. This could be an HTTP proxy or a servlet/filter/handler.