|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.xtvdclient.xtvd.SOAPRequest
public class SOAPRequest
This class builds a SOAP request that targets the TMS XTVD webservice and fetches the resulting XML document. The following code sample shows ways of using this class:
String userName = "scott"; String password = "tiger"; SOAPRequest soapRequest = new SOAPRequest( userName, password ); int numberOfDays = 3; Calendar start = Calendar.getInstance(); Calendar end = Calendar.getInstance(); end.add( Calendar.DAY_OF_YEAR, numberOfDays ); StringWriter writer = new StringWriter( 65536 ); soapRequest.getData( start, end, writer ); String data = writer.toString(); start.add( Calendar.DAY_OF_YEAR, numberOfDays ); end.add( Calendar.DAY_OF_YEAR, numberOfDays * 2 ); String fileName = "/tmp/xtvd.xml"; soapRequest.getDataFile( start, end, fileName ); Xtvd xtvd = new Xtvd(); soapRequest.getData( start, end, xtvd );
Field Summary | |
---|---|
static java.lang.String |
CLOSE_SOAP_BODY
The closing SOAP Body to use to wrap the request. |
static java.lang.String |
CLOSE_SOAP_ENVELOPE
The closing SOAP Envelope to use to wrap the request. |
static java.lang.String |
END_OF_LINE
The system specific end of line character. |
static java.lang.String |
SOAP_BODY
The SOAP Body to use to wrap the request. |
static java.lang.String |
SOAP_ENVELOPE
The SOAP Envelope to use to wrap the request. |
static java.lang.String |
WEBSERVICE_URI
The URI for the TMS XTVD web service. |
static java.lang.String |
XML_HEADER
The XML header to use to wrap the request. |
Constructor Summary | |
---|---|
SOAPRequest()
Default constructor. |
|
SOAPRequest(java.lang.String userName,
java.lang.String password)
Create a new instance of the class with the specified values for userName and password . |
|
SOAPRequest(java.lang.String userName,
java.lang.String password,
java.lang.String uri)
Create a new instance of the class with the specified values for userName , password and webserviceURI . |
Method Summary | |
---|---|
void |
getData(java.util.Calendar start,
java.util.Calendar end,
java.io.Writer writer)
Connect to the webservice and download the XTVD document using the specified parameters. |
void |
getData(java.util.Calendar start,
java.util.Calendar end,
Xtvd xtvd)
Connect to the webservice and download the XTVD document using the specified parameters. |
void |
getDataFile(java.util.Calendar start,
java.util.Calendar end,
java.lang.String file)
Connect to the webservice and download the XTVD document using the specified parameters and write the document to the specified file. |
java.io.Writer |
getLog()
Returns log . |
java.lang.String |
getUserName()
Returns userName . |
java.lang.String |
getWebserviceURI()
Returns webserviceURI . |
void |
setLog(java.io.Writer log)
Set log . |
void |
setPassword(java.lang.String password)
Set password . |
void |
setUserName(java.lang.String userName)
Set userName . |
void |
setWebserviceURI(java.lang.String uri)
Set webserviceURI . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String END_OF_LINE
public static final java.lang.String WEBSERVICE_URI
public static final java.lang.String XML_HEADER
public static final java.lang.String SOAP_ENVELOPE
public static final java.lang.String CLOSE_SOAP_ENVELOPE
public static final java.lang.String SOAP_BODY
public static final java.lang.String CLOSE_SOAP_BODY
Constructor Detail |
---|
public SOAPRequest() throws DataDirectException
webserviceURI
with
the value in WEBSERVICE_URI
, and the sdf
class fields.
Note: You must set the authentication credentials for
the class using the setUserName(String)
and setPassword(String)
mutator methods if you use this form
of the constructor.
DataDirectException
- If a MalformedURLException is
caught while creating a new URL.public SOAPRequest(java.lang.String userName, java.lang.String password) throws DataDirectException
userName
and password
. Use this constructor
if the request is to be made to the default (production)
webservice.
userName
- The userName to use for accessing the webservices.password
- The password associated with the user.
DataDirectException
- If a MalformedURLException is
caught while creating a new URL.public SOAPRequest(java.lang.String userName, java.lang.String password, java.lang.String uri) throws DataDirectException
userName
, password
and webserviceURI
.
userName
- The userName to use for accessing the webservices.password
- The password associated with the user.uri
- The URI for the webservice.
DataDirectException
- If a MalformedURLException is
caught while creating a new URL with the uri parameter.Method Detail |
---|
public void getDataFile(java.util.Calendar start, java.util.Calendar end, java.lang.String file) throws DataDirectException
start
- The date-time from which data is requested.end
- The date-time till which data is requested.file
- The fully qualified name of the file to which
the XTVD document is to be written.
DataDirectException
- If errors are encountered while
interacting with the web service or while writing to the
specified file.getData(Calendar, Calendar, Writer)
public void getData(java.util.Calendar start, java.util.Calendar end, java.io.Writer writer) throws DataDirectException
start
- The date-time from which data is requested.end
- The date-time till which data is requested.writer
- The Writer to which the XML data is to be written.
DataDirectException
- If errors are encountered while
interacting with the web service.sendDownloadRequest(Calendar, Calendar)
,
readSOAPResponse(Writer)
public void getData(java.util.Calendar start, java.util.Calendar end, Xtvd xtvd) throws DataDirectException
Xtvd
object.
start
- The date-time from which data is requested.end
- The date-time till which data is requested.xtvd
- The Xtvd to which the XML data is to be written.
DataDirectException
- If errors are encountered while interacting with the web service.sendDownloadRequest(Calendar, Calendar)
,
readSOAPResponse(Xtvd)
public final java.lang.String getUserName()
userName
.
public final void setUserName(java.lang.String userName)
userName
.
userName
- The value to set.public final void setPassword(java.lang.String password)
password
.
password
- The value to set.public final java.lang.String getWebserviceURI()
webserviceURI
.
webserviceURI
public final void setWebserviceURI(java.lang.String uri) throws DataDirectException
webserviceURI
.
uri
- The value to set.
DataDirectException
- If errors are encountered while
creating a new URL instance.public final java.io.Writer getLog()
log
.
public final void setLog(java.io.Writer log)
log
.
log
- The value to set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |