A Dynamic Web Service automatically generates the query necessary to interact with a target table or view. Dynamic Web Services have always been used by Snapp MX to retrieve the data displayed in Lists and Detail screens. With the release of version 2, they can now be used to insert, update and delete records within Tables.
To perform a database update using a Dynamic Web Service, you simply select the component that the End-User will click on to initiate the web service call (e.g. a button, label, image, tree node, or menu node). You then set the component's "Action" attribute to "Call a Dynamic Web Service". Next, the "DB Interaction" attribute is set to "Insert Record", "Insert/Update Record", or "Delete Record". Finally, the "Action Upon Web Service Completion" is set appropriately if a follow-up screen related action is required. Thats all there is to it. The Dynamic Web Service takes care of the rest.
For more complex situations, Snapp MX also supports Custom Web Services. A Custom Web Service must be used to:
- perform a database update when a screen is connected to a View;
- validate login credentials;
- set login or screen variables;
- perform additional processing tasks (i.e. multi-table updates, conditional logic, etc.); or
- interact with an external (non-Snapp MX) web service.
- The component initiating the Web Service call (e.g. a button, label, image, tree node, or menu node) is selected.
- The "Action" attribute of this component is set to "Call a Web Service". The "Web Service Name" and "Function Name" are then auto-filled (these can be changed if need be).
- If a database a table/view needs to be updated, then the type of "DB Interaction" (i.e. "Insert Record", "Insert/Update Record", or "Delete Record") is set. This action tells the Web Service Generator to add in the necessary SQL statements. Snapp MX will also add default "Web Service Arguments" (i.e. information that is passed to the Web Service). Additional, arguments can also be added should they be required.
- The "Template" button is clicked to generate the Custom Web Service code which then appears in a pop up window.
- The code in this window must then be transfered to a text/code editor so that it can be updated to fit the final processing requirements. Once edited, save the code with the filename identified at the top of the code (e.g. UserDetails_9_3.cfc)
- If a Java or .NET application server is being used then the code must be compiled before it is ready to use. For more information on compiling go to Snapp MX Tutorials and review Basic Tutorials > Creating a Login Screen > Step 8: Creating a Web Service.
- Finally, move the Web Service file to the directory also identified at the top of the code (e.g. f:\www\MyCList\site\1\com).
For more information about Web Services, review the Snapp MX Tutorials and/or the Snapp MX Help documentation.


