superwaba.ext.xplat.webservice
Class XmlRpcClient

java.lang.Object
  |
  +--superwaba.ext.xplat.xml.XmlTokenizer
        |
        +--superwaba.ext.xplat.xml.XmlReader
              |
              +--superwaba.ext.xplat.webservice.XmlRpcClient

public class XmlRpcClient
extends XmlReader

Handles XML-RPCs to a server. The following files must be installed in the device: XPlatHtml.pdb, XPlatWebservice.pdb, XPlatIoHttp.pdb, XPlatUtilCrypto.pdb, XPlatUtilProps.pdb, XPlatXML.pdb, XPlatZlib.pdb (Zlib also requires the native counterpart such as a dll or a prc).


Field Summary
protected  XmlRpcContentHandler xmlHandler
           
 
Fields inherited from class superwaba.ext.xplat.xml.XmlReader
converter, tagNameHashId
 
Constructor Summary
XmlRpcClient(java.lang.String hostname, int port, java.lang.String uri)
           
XmlRpcClient(java.lang.String hostname, int port, java.lang.String uri, boolean doCompression)
          Creates a xmlrpc client with compression if the given flag is true.
XmlRpcClient(java.lang.String hostname, int port, java.lang.String uri, byte[] key)
          Creates a xmlrpc client which encrypts the data using the BlowfishECB.
XmlRpcClient(java.lang.String hostname, int port, java.lang.String uri, byte[] key, boolean doCompression)
          Creates a xmlrpc client with compression which encrypts the data using the BlowfishECB.
XmlRpcClient(java.lang.String hostname, int port, java.lang.String uri, java.lang.String key)
          Creates a xmlrpc client which encrypts the data using the BlowfishECB.
XmlRpcClient(java.lang.String hostname, int port, java.lang.String uri, java.lang.String key, boolean doCompression)
          Creates a xmlrpc client with compression which encrypts the data using the BlowfishECB.
 
Method Summary
 java.lang.Object execute(java.lang.String method, Vector params)
          Generates an XML-RPC request and sends it to the server.
protected  int getTagCode(byte[] b, int offset, int count)
          Method to compute the tag code identifying a tag name.
protected  void writeObject(java.lang.Object what)
          Writes the XML representation of a supported Java object to the XML writer.
 
Methods inherited from class superwaba.ext.xplat.xml.XmlReader
foundAttributeName, foundAttributeValue, foundCharacter, foundCharacterData, foundComment, foundEndEmptyTag, foundEndOfInput, foundEndTagName, foundStartTagName, getContentHandler, parse, parse, parse, parse, setAttributeListFilter, setContentHandler, setNewlineSignificant
 
Methods inherited from class superwaba.ext.xplat.xml.XmlTokenizer
disableReferenceResolution, foundDeclaration, foundInvalidData, foundProcessingInstruction, foundReference, foundStartOfInput, getAbsoluteOffset, isDataCDATA, resolveCharacterReference, setCdataContents, setStrictlyXml, tokenize, tokenize, tokenize, tokenize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlHandler

protected XmlRpcContentHandler xmlHandler
Constructor Detail

XmlRpcClient

public XmlRpcClient(java.lang.String hostname,
                    int port,
                    java.lang.String uri)
             throws XmlRpcException
Parameters:
hostname - The server address to connect to
port - The port on the server to connect to
uri - The connecting uri. Defaults to "/RPC2"
Throws:
XmlRpcException - If the connection to the server was unsuccessful

XmlRpcClient

public XmlRpcClient(java.lang.String hostname,
                    int port,
                    java.lang.String uri,
                    byte[] key)
             throws XmlRpcException
Creates a xmlrpc client which encrypts the data using the BlowfishECB. The key must have up to 56 bytes.

XmlRpcClient

public XmlRpcClient(java.lang.String hostname,
                    int port,
                    java.lang.String uri,
                    java.lang.String key)
             throws XmlRpcException
Creates a xmlrpc client which encrypts the data using the BlowfishECB. The key must have up to 56 bytes when converted from chars.

XmlRpcClient

public XmlRpcClient(java.lang.String hostname,
                    int port,
                    java.lang.String uri,
                    boolean doCompression)
             throws XmlRpcException
Creates a xmlrpc client with compression if the given flag is true.

XmlRpcClient

public XmlRpcClient(java.lang.String hostname,
                    int port,
                    java.lang.String uri,
                    java.lang.String key,
                    boolean doCompression)
             throws XmlRpcException
Creates a xmlrpc client with compression which encrypts the data using the BlowfishECB. The key must have up to 56 bytes.

XmlRpcClient

public XmlRpcClient(java.lang.String hostname,
                    int port,
                    java.lang.String uri,
                    byte[] key,
                    boolean doCompression)
             throws XmlRpcException
Creates a xmlrpc client with compression which encrypts the data using the BlowfishECB. The key must have up to 56 bytes when converted from chars.
Method Detail

execute

public java.lang.Object execute(java.lang.String method,
                                Vector params)
                         throws XmlRpcException
Generates an XML-RPC request and sends it to the server. Parses the result and returns the corresponding Java object.
Parameters:
method - The remote procedure to call
params - The parameters to the corresponding method
Throws:
XmlRpcException - If the remote procedure call was unsuccessful

getTagCode

protected int getTagCode(byte[] b,
                         int offset,
                         int count)
Description copied from class: XmlReader
Method to compute the tag code identifying a tag name.

This is the value which is passed to ContentHandler's for reporting a tag name.  Derived class may override it.

Overrides:
getTagCode in class XmlReader
Tags copied from class: XmlReader
Parameters:
b - byte array containing the bytes to be hashed
offset - position of the first byte in the array
count - number of bytes to be hashed
Returns:
the corresponding hash code

writeObject

protected void writeObject(java.lang.Object what)
Writes the XML representation of a supported Java object to the XML writer.
Parameters:
what - The object to write