net.sf.basedb.ws.server
Class AbstractRPCService
java.lang.Object
net.sf.basedb.ws.server.AbstractRPCService
- Direct Known Subclasses:
- AnnotationTypeService, ArrayDesignService, BioAssaySetService, ExperimentService, ProjectService, RawBioAssayService, ReporterService, SessionService
public abstract class AbstractRPCService
- extends Object
An abstract class for Web service classes to extend from.
This contains common methods and fields for WebService classes
on the server side in BASE.
- Version:
- 2.5
- Author:
- Nicklas, Martin
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
util
protected ServicesUtil util
AbstractRPCService
protected AbstractRPCService()
getSessionControl
protected SessionControl getSessionControl(String ID)
- Gets the SessionControl for a given session ID.
- Parameters:
ID
- Id for which SessionControl should be returned.
- Returns:
- SessionControl object
getRemoteId
protected String getRemoteId()
- Gets the remote id to identify connection with.
- Returns:
- A string with the address to the connected client.
attachFile
protected org.apache.axiom.om.OMElement attachFile(DataSource dataSource,
String elementName)
- Attach a file to an OMElement so it can be sent with webservices.
Following code shows an example of how to get to the file on the client side:
OMElement response = .....
OMElement fileElement = response.getFirstElement();
OMElement dataElement = fileElement.getFirstElement();
OMText node = (OMText) dataElement.getFirstOMChild();
DataHandler dataHandler = (DataHandler) node.getDataHandler();
InputStream in = dataHandler.getInputStream();
- Parameters:
dataSource
- A DataSource to be attached to an OMElement.elementName
- The name to call the element by.
- Returns:
- OMElement where the file is attached to.