Simple example how to access xmlBlaster with C and XmlRpc ========================================================= Installation: ============= Download XmlRpc lib from: http://xmlrpc-c.sourceforge.net/ This XmlRpc implementation needs the W3C HTTP client library (download from http://www.w3.org/Library/) Compile (on UNIX): ================== cd ~/w3c-libwww-pre-5.3.0 ------------------------- ./configure --prefix=${HOME}/xmlrpc_libwww --without-expat --without-ssl make make install Libraries have been installed in: ${HOME}/xmlrpc_libwww/lib export LD_LIBRARY_PATH=${HOME}/xmlrpc_libwww/lib export PATH=${HOME}/xmlrpc_libwww/bin:$PATH cd ~/xmlrpc-c-0.9.9 (http://xmlrpc-c.sourceforge.net/) ------------------- ./configure --prefix=${HOME}/xmlrpc_bin Libraries have been installed in: ${HOME}/xmlrpc_bin/lib export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/xmlrpc_libwww/lib:${HOME}/xmlrpc_bin/lib export PATH=${HOME}/xmlrpc_libwww/bin:${HOME}/xmlrpc_bin/bin:$PATH cd /demo/c/xmlrpc ---------------------------------- CLIENT_CFLAGS=`xmlrpc-c-config libwww-client --cflags` CLIENT_LIBS=`xmlrpc-c-config libwww-client --libs` gcc $CLIENT_CFLAGS -o client client.c $CLIENT_LIBS -Wall SERVER_CFLAGS=`xmlrpc-c-config abyss-server --cflags` SERVER_LIBS=`xmlrpc-c-config abyss-server --libs` gcc $SERVER_CFLAGS -o callbackServer callbackServer.c $SERVER_LIBS -Wall Run it: ======= 1. Start xmlBlaster server export CLASSPATH=/lib/xmlBlaster.jar java org.xmlBlaster.Main 2. Start the XmlRpc-c callbackServer, this will receive the data on http://myHost:8081/RPC2 (as configured in abyss.conf): callbackServer abyss.conf Please edit abyss.conf before starting, e.g. set 'Port 8081' and adjust ServerRoot to point to your xmlrpc-c installation document root, e.g.: ServerRoot /home/xmlblast/xmlBlaster/demo/c/xmlrpc/xmlrpc-c-0.9.9/conf/abyss_root 3. Start this client: client -xmlrpc.serverUrl http://myHost:8080/ -xmlrpc.cbUrl http://myHost:8081/RPC2 -loginName ben -passwd secret -dest ben -msgFile hello.xml the -msgFile allows to send any file (binary data as well). It will login as user 'ben', and send to user 'ben' a PtP message (You may also want to start a Java client to receive the messages like: java org.xmlBlaster.client.reader.SubscribeMessage -loginName ben -passwd secret -oid __cmd:?totalMem ) Note: ===== When the client start (see 3.), it publishes the callback address of the callbackServer (see 2., as configured in abyss.conf). We need to do this, since the callback server itself has no way to tell its callback address to xmlBlaster. Note: ===== I'm not shure if i have detected all possible memory leaks. 01/2002 marcel