org.osesb.test.filereceiverservice.ejb20
Class FileReceiverWSBean

java.lang.Object
  extended by org.osesb.test.filereceiverservice.ejb20.FileReceiverWSBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class FileReceiverWSBean
extends java.lang.Object
implements javax.ejb.SessionBean

FileReceiverWSBean stateless session bean is configured as a test web service with one method:

receiveFile() expects a XML message that includes one entry for each attachment.

<testFiles xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
          <testFile>
              <fileName>Apas-Track2.mp3</fileName>
              <mimeType xmime:contentType="audio/mpeg" />
          </testFile>
          <testFile>
              <fileName>Dry Ice Video.wmv</fileName>
              <mimeType xmime:contentType="video/x-ms-wmv" />
          </testFile>
      </testFiles>
 

receiveFile() assumes that a JAXRPCServerAttachmentHandler is configured in the handler chain and that the handler has detached the attachments and set the ThreadLocal variable, 'attachmentList', to a List of AttachmentDescriptor Objects, one for each attachment.

receiveFile() assumes that FileReceiverWSBean has been configured with an environment variable named 'destinationDirectoryURL'. receiveFile() saves the attachments to the directory given by the 'destinationDirectoryURL' environment variable.

Since:
Version .9
See Also:
Serialized Form

Constructor Summary
FileReceiverWSBean()
           
 
Method Summary
 void ejbActivate()
           
 void ejbCreate()
          ejbCreate().
 void ejbPassivate()
           
 void ejbRemove()
           
 javax.ejb.SessionContext getSessionContext()
           
 void receiveFile(java.lang.String xmlMessage)
          Method exposed by WSDL to jax-rpc clients that takes a single, String, parameter (usually XML).
 void setSessionContext(javax.ejb.SessionContext sessionContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileReceiverWSBean

public FileReceiverWSBean()
Method Detail

receiveFile

public void receiveFile(java.lang.String xmlMessage)
                 throws java.lang.Exception
Method exposed by WSDL to jax-rpc clients that takes a single, String, parameter (usually XML).

Parameters:
xmlMessage - The received message.
Throws:
java.lang.Exception - if called with empty messageText or if there is an error during attachment processing.

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
ejbCreate().

Throws:
javax.ejb.CreateException

ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface javax.ejb.SessionBean

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext sessionContext)
Specified by:
setSessionContext in interface javax.ejb.SessionBean

getSessionContext

public javax.ejb.SessionContext getSessionContext()