com.partnersoft.net.soap
Class SoapExchange

java.lang.Object
  extended by com.partnersoft.net.soap.SoapExchange

public class SoapExchange
extends java.lang.Object

Allows you to configure, build, and run a SOAP web service XML exchange.

This is a low-level implementation of SOAP; it expects you to have generated the entire SOAP message yourself and that you will parse the response yourself. It takes care of connecting, sending the request, and receiving the response. Various input and output methods are available - streams, files, or strings.

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis, Jeremy Tarver

Constructor Summary
SoapExchange()
           
SoapExchange(java.io.InputStream inStream)
           
SoapExchange(SoapRequest inReader)
           
SoapExchange(SoapRequest inReader, SoapResponse inWriter)
           
SoapExchange(java.lang.String inString)
           
SoapExchange(VfsFile inFile)
           
 
Method Summary
 void exchange()
          Do the actual exchange.
 java.lang.String getResponseAsString()
          Get the response as a string.
 void parseResponseWith(XmlActor responseActor)
          Sets an actor that will be used to parse the response.
 void setAction(java.lang.String newAction)
          Set the SOAP Action.
 void setRequestReader(SoapRequest inRequestReader)
          Sets the inputstream
 void setTimeout(Duration newTimeout)
          Set the timeout duration.
 void setUrl(java.net.URL newUrl)
          Sets the SOAP URL.
 void setUrlString(java.lang.String newUrlString)
          Sets the SOAP URL from a String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoapExchange

public SoapExchange()

SoapExchange

public SoapExchange(VfsFile inFile)
             throws java.io.IOException
Throws:
java.io.IOException

SoapExchange

public SoapExchange(java.io.InputStream inStream)

SoapExchange

public SoapExchange(java.lang.String inString)
             throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

SoapExchange

public SoapExchange(SoapRequest inReader)

SoapExchange

public SoapExchange(SoapRequest inReader,
                    SoapResponse inWriter)
Method Detail

exchange

public void exchange()
              throws java.io.IOException
Do the actual exchange. If you provided an output stream or file, the response is written there. If not, you can retrieve them from getResponseAsString().

Throws:
java.io.IOException

setRequestReader

public void setRequestReader(SoapRequest inRequestReader)
Sets the inputstream


parseResponseWith

public void parseResponseWith(XmlActor responseActor)
Sets an actor that will be used to parse the response.


setUrl

public void setUrl(java.net.URL newUrl)
Sets the SOAP URL.


setUrlString

public void setUrlString(java.lang.String newUrlString)
Sets the SOAP URL from a String


setAction

public void setAction(java.lang.String newAction)
Set the SOAP Action.


setTimeout

public void setTimeout(Duration newTimeout)
Set the timeout duration. Default is ten minutes.


getResponseAsString

public java.lang.String getResponseAsString()
Get the response as a string. This is only non-null when you do not specify either a stream or file to output to, and then only after the exchange has occurred.