Hello,
When trying to execute the following:
try {
Vector xVector = new Vector();
Hashtable xHashTable = new Hashtable();
xHashTable.put(RPCDefaultMessage.COLLECTION, "/db/" + collectionPath); // Path to root collection for this application
xHashTable.put(RPCDefaultMessage.TYPE, "XUpdate"); // Type of Query
xHashTable.put(RPCDefaultMessage.NAMESPACES, new Hashtable()); // Don't know why this is used
xHashTable.put(RPCDefaultMessage.QUERY, xUpdateQueryString);
/* where xUpdateQueryString is
<xupdate:modifications version="1.0" xmlns:xupdate="http://www.xmldb.org/update">
<xupdate:insert-after select="/document/testdoc/testing">
<xupdate:element name="country">Belgium</xupdate:element>
</xupdate:insert-after>
</xupdate:modifications>
*/
xHashTable.put(RPCMessageInterface.MESSAGE_PARAM, "Query"); // this is a queryQuery
xVector.addElement(xHashTable);
Hashtable returnedHashtable = (Hashtable) xClient.execute("run", xVector);
Object resultObject = returnedHashtable.get(RPCDefaultMessage.RESULT);
Log.debug("Result object: " + resultObject.getClass().getName());
return true;
} catch (XmlRpcException e) {
Log.error("XML-RPC exception:", e);
return false;
} catch (IOException e) {
Log.error("IO exception:", e);
return false;
}
I get the following exception:
ERROR [12:45:15,250] - AAdaptor - XML-RPC exception:
org.apache.xmlrpc.XmlRpcException: java.lang.Exception: org.apache.xindice.core.query.CompilationException: Error Compiling XUpdate Query
at org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java)
Is there something wrong with:
<xupdate:modifications version="1.0" xmlns:xupdate="http://www.xmldb.org/update">
<xupdate:insert-after select="/document/testdoc/testing">
<xupdate:element name="country">Belgium</xupdate:element>
</xupdate:insert-after>
</xupdate:modifications>
??
And what exactly does xHashTable.put(RPCDefaultMessage.NAMESPACES, new Hashtable()); do ? Do I have to add something to the hashtable?
Thanks
Wim
-----Disclaimer-----
This message may contain confidential information intended solely for the use of the named addressee. If you are not the intended recipient, you should not read, use, disclose or reproduce the content of this message. If you have received this message by mistake, please notify the sender immediately. Any views or opinions presented in this message are solely those of the author and do not necessarily represent those of AXA Belgium, AXA Bank Belgium, AXA Tech Belgium GIE - ESV or any other entity of the AXA Group, unless otherwise stated by the sender and duly authorized by the said companies.
---------------------