FileReceived Web Service
The FileReceived Web Service, sometimes referred to as AsFile, exposes extensions before and after the insert operation occurs. The FileReceived lifecycle is illustrated below, along with the associated insert extension opportunities.
- The basic lifecycle for the FileReceived Web Service is:
- The FileReceived Web Service receives a request via a SOAP message.
- The AsFile entry is looked up using the FileID specified in the request.
- The math in the AsFile entry's XMLData is processed.
- The attributes in the AssignAttributes section of the AsFile entry's XMLData are processed.
- The XSLT maps the request XML to AsXml.
- The transformed AsXml is mapped to data objects.
- PreInsert operations are performed on the objects.
- Objects are inserted into the database.
- PostInsert operations are performed on the objects.
- Output XSLT is loaded from AsFileOutput based on the attributes in AssignAttributes.
- Response XML is built.
- If the ValidationError section is configured in the XSLT, then a SOAP fault is created (with embedded response XML) and sent to the caller. Otherwise, response AsXml is returned.
Example XML Configuration
<File> <RequestType>...</RequestType> <Math ID="MathVariablePrefix"> <MathVariables> <MathVariable>...</MathVariable> ... </MathVariables> </Math> <AssignAttributes>...</AssignAttributes> <PreInsert> <Object CLASS="com.example.extension.PreInsertExtension"> <Parameters> <Parameter NAME="Name">Value</Parameter> <Parameter NAME="Name">Value</Parameter> ... </Parameters> </Object> <Object CLASS="com.example.extension.PreInsertExtension2" /> </PreInsert> <PostInsert> <Object CLASS="com.example.extension.PostInsertExtension" /> <Object CLASS="com.example.extension.PostInsertExtension2" /> ... </PostInsert> </File> |
Java Implementation Details
The PreInsert and PostInsert extensions must implement the IFilePreInsertProcessorBll and IFilePostInsertProcessorBll, respectively. If the Parameters element is present, the specified parameters will be passed to the extension. The text of the Parameter elements should contain either a constant or the name of an attribute from the AssignAttributes section. This allows for the passage of data to the defined extensions.
The PreInsert interface is defined as:
public interface IFilePreInsertProcessorBll { public <T extends AdminServerPersistentDcl> ArrayList <T> process ( ArrayList <T> dclList, String requestXml, Map <String, String> parameterMap ) throws AsExceptionUtl; } The PostInsert interface is defined as: public interface IFilePostInsertProcessorBll { public <T extends AdminServerPersistentDcl> String process ( ArrayList <T> dclList, String requestXml, Map <String, String> parameterMap ) throws AsExceptionUtl; } |