com.pushtotest.tool.protocolhandler
Class ApacheSOAPProtocol

java.lang.Object
  extended by com.pushtotest.tool.protocolhandler.ProtocolWrapper
      extended by com.pushtotest.tool.protocolhandler.ApacheSOAPProtocol
All Implemented Interfaces:
Protocol, java.lang.Runnable

public class ApacheSOAPProtocol
extends ProtocolWrapper

This is the Protocol implementation to deal with the SOAP protocol. We will probably piggy back of the HTTPProtocol object since SOAP is most often over HTTP, but we will probably want to look into doing SOAP calls over HTTPS too.


Field Summary
 
Fields inherited from class com.pushtotest.tool.protocolhandler.ProtocolWrapper
body, errno, header, host, name, pass, path, port, proxyHost, proxyPass, proxyPort, proxyUser, query, response, running, scheme, timeout, type, url
 
Fields inherited from interface com.pushtotest.tool.protocolhandler.Protocol
IOERROR, NOERROR, NOTREADY, OTHER, TIMEOUT
 
Constructor Summary
ApacheSOAPProtocol()
          Creates a new instance of the ApacheSOAPProtocol.
 
Method Summary
 Response connect()
          Calling this method actually causes the connection to be made.
 java.lang.String id()
          Returns an id for this protocol.
 void send()
          Make a Document style soap call.
 void setActionURI(java.lang.String uri)
          Set the actionURI header value.
 void setEncoding(java.lang.String enc)
          Sets the SOAP request encoding type.
 boolean supports(java.lang.String id)
          Tests to see if this protocol will support a specific type.
 
Methods inherited from class com.pushtotest.tool.protocolhandler.ProtocolWrapper
getBody, getErrno, getHost, getPassword, getResponse, getTimeout, getUrl, getUrl, getURL, getUsername, isRunning, parseUrl, run, setBody, setErrno, setHeader, setHost, setPassword, setPath, setPort, setProxyHost, setProxyPass, setProxyPort, setProxyUser, setQueryString, setScheme, setTimeout, setType, setUrl, setUsername, supportsBody, supportsHeader, supportsResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApacheSOAPProtocol

public ApacheSOAPProtocol()
Creates a new instance of the ApacheSOAPProtocol.

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 Protocol
Specified by:
id in class ProtocolWrapper
Returns:
The id for this Protocol.

setActionURI

public void setActionURI(java.lang.String uri)
Set the actionURI header value.

Parameters:
uri - The Aaction URI for this SOAP Call.

supports

public boolean supports(java.lang.String id)
Tests to see if this protocol will support a specific type. Can be used to determine if a given Header can be passed into this Protocol. This implementation accepts either an 'http' header or a 'soap' header in case someone wants to make a soap specific version.

Overrides:
supports in class ProtocolWrapper
Parameters:
id - The string id to test.
Returns:
True if this id is supported by this Protocol instance.

setEncoding

public void setEncoding(java.lang.String enc)
Sets the SOAP request encoding type. For example, Constants.NS_URI_LITERAL_XML uses literal encoding.

Parameters:
enc - type (for example, Constants.NS_URI_LITERAL_XML, NS_URI_SOAP_ENC (default)

connect

public Response connect()
                 throws NotReadyException,
                        NoSuchClassException,
                        ToolException,
                        java.io.IOException
Calling this method actually causes the connection to be made. It will do the work of making the connection, gathering the response, etc.

Specified by:
connect in interface Protocol
Specified by:
connect in class ProtocolWrapper
Returns:
The response object that is the appropriate type for this Protocol.
Throws:
NotReadyException - If the connect is called without all of the proper pieces set that it needs to connect to the given protocol.
NoSuchClassException - If a timeout was set and that timeout is reached before the connection is completed.
ToolException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!

send

public void send()
Make a Document style soap call.

Specified by:
send in class ProtocolWrapper
Parameters:
call - The SOAP Call to use.
response - The object to write the response information to.
url - The URL to connect to.
start - The start time for logging.
Throws:
ToolException - General errors.
java.io.IOException - When there is trouble reading from the response or writing the request.