cassandradriver-v1-1-xml-sample

Sample requesting XML with V.1.1

Assuming you have C.U.D. on port 80 of 127.0.0.1, then you pass the parameter format=xml

http://127.0.0.1/cgi-bin/cud.py?format=xml&cluster=127.0.0.1&user=test&password=test&keyspace=test&cql=SELECT+*+FROM mytable

cassandradriver-v1-1-xml-sample

The response in raw is:

<?xml version='1.0' standalone='yes'?>
<response>
    <status>
        <error_code>0</error_code>
        <error_description>Data returned Ok</error_description>
        <rows_returned>2</rows_returned>
    </status>
    <data>
        <row>
            <thekey>second</thekey>
            <col1>Carles Mateo</col1>
            <col2>http://blog.carlesmateo.com</col2>
        </row>
        <row>
            <thekey>first</thekey>
            <col1>Carles Mateo</col1>
            <col2>http://blog.carlesmateo.com</col2>
        </row>
     </data>
</response>

The sample application on client_samples/php/sample_www_form.php provides a sample, and a graphical tool, to query the Cassandra Universal Driver using PHP and simplexml_load_file (or text/plain).

cassandradriver-www_form-query-tool-xml

One thought on “Sample requesting XML with V.1.1”

Leave a Reply

Your email address will not be published. Required fields are marked *