com.pushtotest.tool.protocolhandler
Class XMLRPCBody

java.lang.Object
  extended by com.pushtotest.tool.protocolhandler.XMLRPCBody
All Implemented Interfaces:
Body

public class XMLRPCBody
extends java.lang.Object
implements Body

This is an implementation of the Body interface for the XMLRPC Protocol.


Constructor Summary
XMLRPCBody()
           
 
Method Summary
 void addHeaders(java.net.HttpURLConnection con)
          Not needed in this context
 void addParameter(java.lang.String arg)
          Adds a String parameter to the parameter list for this XMLRPC call
 void addParameter(java.lang.String name, java.lang.String value)
          Adds a new child to the call document containing the name/value pair, this ignores the name and stores the value.
 java.lang.String getBody()
          Not needed in this context
 java.lang.String getMethod()
          Returns the method on the host to be called.
 java.util.Vector getParams()
          Returns the Parameters for this SOAP object.
 java.lang.String getTarget()
          Retunrs the target URI that is set for this call.
 java.lang.String getTransport()
          Returns the transport to be used.
 java.lang.String id()
          Returns an id for this protocol.
 void setMethod(java.lang.String method)
          Sets the method that will be called on the host.
 void setTarget(java.lang.String target)
          Sets the target URI for this XMLRPC call.
 void setTransport(java.lang.String transport)
          Sets the transport to be used.
 java.lang.String toString()
          Returns the content of the body to be used by the Protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLRPCBody

public XMLRPCBody()
Method Detail

id

public java.lang.String id()
Returns an id for this protocol. The id is a string that will be used to uniquily identify the protocol. For example
:// would be appropriate (without the "://")
.

Specified by:
id in interface Body
Returns:
The id for this Protocol.

toString

public java.lang.String toString()
Returns the content of the body to be used by the Protocol.

Overrides:
toString in class java.lang.Object
Returns:
All of the content that should be sent as the Protocol body.

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String value)
Adds a new child to the call document containing the name/value pair, this ignores the name and stores the value. Instructions on adding other types of parameters the Parameter constructor used in addElement can take several types of parameters controlled by the second param of the new Parameter constructor.
For example, if I wanted to pass a Double to the Web Service I could use this:
new Parameter( "arg1", double.class, new Double (arg1), null )

Specified by:
addParameter in interface Body
Parameters:
name - The parameter name
value - The parameter value.

addParameter

public void addParameter(java.lang.String arg)
Adds a String parameter to the parameter list for this XMLRPC call

Parameters:
arg - The parameter itself.

getParams

public java.util.Vector getParams()
Returns the Parameters for this SOAP object.

Returns:
The parameters that were set for this XMLRPC call.

setTarget

public void setTarget(java.lang.String target)
Sets the target URI for this XMLRPC call. This is usually a host like http://localhost:8080

Parameters:
target - The Target URI to set.

getTarget

public java.lang.String getTarget()
Retunrs the target URI that is set for this call.

Returns:
The Target URI.

setMethod

public void setMethod(java.lang.String method)
Sets the method that will be called on the host.

Parameters:
target - The Target URI to set.

getMethod

public java.lang.String getMethod()
Returns the method on the host to be called.

Returns:
The Target URI.

setTransport

public void setTransport(java.lang.String transport)
Sets the transport to be used. This is http by default.

Parameters:
target - The Target URI to set.

getTransport

public java.lang.String getTransport()
Returns the transport to be used.

Returns:
The Target URI.

getBody

public java.lang.String getBody()
                         throws ToolException
Not needed in this context

Specified by:
getBody in interface Body
Returns:
All of the content that should be sent as the Protocol body.
Throws:
ToolException

addHeaders

public void addHeaders(java.net.HttpURLConnection con)
Not needed in this context

Specified by:
addHeaders in interface Body
Parameters:
con - The HttpURLConnection object that will communicate with the host using HTTP protocols