Database Reference
In-Depth Information
process the XML document responses. However, eXist's XML-RPC API was never
really designed to be used in this way. Thus, the contents of the XML documents for
performing XML-RPC operations with eXist are not well documented. As it is a sim‐
ple protocol of just XML over HTTP, though, if you are so inclined you can reverse-
engineer it by reading the XML-RPC specification and studying the interface for
eXist's XML-RPC API functions (in the org.exist.xmlrpc.RpcApi Java class , and
the associated RpcApi JavaDoc ). In fact, that is exactly the aim of this chapter. Rather
than try to explain the entirety of eXist's XML-RPC API, in which there are over 122
available functions, we explain the methodology and tools needed to make use of this
API.
Another option available to you is to use a network sniffing tool such as Wireshark to
examine XML-RPC network traffic sent to and from eXist. For example, let's take a
look at the first XML-RPC request made by eXist's Java Admin Client after you click
Login. This traffic was captured using Wireshark:
POST /exist/xmlrpc HTTP/1.1
Content-Type: text/xml
User-Agent: Apache XML RPC 3.1.3 (Sun HTTP Transport)
Authorization: Basic YWRtaW46
Cache-Control: no-cache
Pragma: no-cache
Host: localhost:8080
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 273
<?xml version="1.0" encoding="UTF-8"?>
<methodCall xmlns:ex="http://ws.apache.org/xmlrpc/namespaces/extensions">
<methodName>existsAndCanOpenCollection</methodName>
<params>
<param>
<value>/db</value>
</param>
</params>
</methodCall>
Shows that this is just an HTTP POST to /exist/xmlrpc
Shows that we are just sending XML in the body of the request, which is exactly
what we would expect for XML-RPC
Shows that we are authenticating with the server using basic authentication (e.g.,
our encoded admin username and password)
Shows the server we are HTTP POST ing to—that is, localhost port 8080
Search WWH ::




Custom Search