com.pushtotest.tool.protocolhandler
Class SOAPBody

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

public class SOAPBody
extends java.lang.Object
implements Body

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


Constructor Summary
SOAPBody()
           
 
Method Summary
 void addHeaders(java.net.HttpURLConnection con)
          Not needed in this context
 void addParameter(java.lang.String name, java.lang.Class classtype, java.lang.Object arg, java.lang.String encoding)
          Adds any kind of parameter to the parameter list for this SOAP call
 void addParameter(java.lang.String name, java.lang.Object arg, java.lang.String encoding)
          Adds a new child to the call document containing the name/value pairs.
 void addParameter(java.lang.String name, java.lang.String value)
          Adds a new child to the call document containing the name/value pair
 java.lang.String getBody()
          Not needed in this context
 org.jdom.Document getDocument()
          Returns an XML document, if one was previously set otherwise returns null.
 org.jdom.Document getJDOMDocument()
          Returns an XML document in org.jdom.Document object form if one was previously set otherwise returns null.
 java.lang.String getMethod()
          Returns the method name that is set on this object.
 java.util.Vector getParams()
          Returns the Parameters for this SOAP object.
 java.lang.String getSOAPEncoding()
          Returns the SOAP envelope encoding style.
 java.lang.String getTarget()
          Returns the target URI that is set for this call.
 java.lang.String getXMLDocument()
          Returns an XML document in a String, if one was previously set otherwise returns null.
 java.lang.String id()
          Returns an id for this protocol.
 boolean isDocStyle()
          Returns true if a document was set using setDocument()
 void setDocument(org.jdom.Document thedoc)
          Takes an entire XML request document stored in a JDOM Document object for this SOAP call.
 void setDocument(java.lang.String thedoc)
          Takes an entire XML request document stored in a string for this SOAP call.
 void setMethod(java.lang.String method)
          Sets the method to call on the remote SOAP object.
 void setSOAPEncoding(java.lang.String encoding)
          Sets the SOAP envelope encoding style for a SOAP document-style encoded request.
 void setTarget(java.lang.String target)
          Sets the target URI for this SOAP call.
 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

SOAPBody

public SOAPBody()
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

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

addParameter

public void addParameter(java.lang.String name,
                         java.lang.Object arg,
                         java.lang.String encoding)
Adds a new child to the call document containing the name/value pairs.

Parameters:
name - The name of the parameter
arg - The argument itself.
encoding - Any encoding needed - probably null.

addParameter

public void addParameter(java.lang.String name,
                         java.lang.Class classtype,
                         java.lang.Object arg,
                         java.lang.String encoding)
Adds any kind of parameter to the parameter list for this SOAP call

Parameters:
name - The name of the parameter
classtype - The type of the paramater argument.
arg - The argument itself.
encoding - Any encoding needed - probably null.

setDocument

public void setDocument(org.jdom.Document thedoc)
Takes an entire XML request document stored in a JDOM Document object for this SOAP call. When this method is used then Tool uses a document-style SOAP request. See http://www.jdom.org for details on JDOM.

Parameters:
org.jdom.Document - document

setDocument

public void setDocument(java.lang.String thedoc)
Takes an entire XML request document stored in a string for this SOAP call. When this method is used then Tool uses a document-style SOAP request.


getDocument

public org.jdom.Document getDocument()
Returns an XML document, if one was previously set otherwise returns null.

Returns:
org.jdom.Document document

getJDOMDocument

public org.jdom.Document getJDOMDocument()
Returns an XML document in org.jdom.Document object form if one was previously set otherwise returns null.

Returns:
org.jdom.Document document

getXMLDocument

public java.lang.String getXMLDocument()
Returns an XML document in a String, if one was previously set otherwise returns null.

Returns:
String document

isDocStyle

public boolean isDocStyle()
Returns true if a document was set using setDocument()


getParams

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

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

setMethod

public void setMethod(java.lang.String method)
Sets the method to call on the remote SOAP object.

Parameters:
method - The method name.

getMethod

public java.lang.String getMethod()
Returns the method name that is set on this object.

Returns:
The method name that will be called.

setTarget

public void setTarget(java.lang.String target)
Sets the target URI for this SOAP call. It will normally be something like: urn:SomeThing

Parameters:
target - The Target URI to set.

getTarget

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

Returns:
The Target URI.

setSOAPEncoding

public void setSOAPEncoding(java.lang.String encoding)
Sets the SOAP envelope encoding style for a SOAP document-style encoded request. Ignored for SOAP RPC-encoded requests. This is typically: "http://schemas.xmlsoap.org/soap/encoding/" for SOAP RPC encoding and "http://xml.apache.org/xml-soap/literalxml" for document-style requests.


getSOAPEncoding

public java.lang.String getSOAPEncoding()
Returns the SOAP envelope encoding style. See setSOAPEncoding() for details.


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