Understanding the way Web Services are used in Morfik

Web Services are used all throughout the Morfik Framework, forming the basis of all communication between the browser and the server side portions of the application. This is true even for internal Framework communications which are not specifically designed for integration or interaction with other applications, so whenever you navigate inside a Morfik application or open a popup form, Web Service standards compliant calls are being made to the server.

Web Methods

WebMethods are a web version of the relational database’s stored procedures. They are routines or services which can be called when required by your application or be published so as to be called from other applications. WebMethods are implemented fully on the server, but have a Browser side component so as to allow easy usage from within the same XApp. It is through the creation of WebMethods that you build the Web Services interface of your XApp. Read more...

Database Navigation

The Morfik Framework implements internally all the plumbing necessary for smooth database navigation and data pagination. This allows your application to display information retrieved from a database in an optimized manner. No downloading of unnecessary records, on demand download of large chunks of data such as blobs and other such situations are all taken care of internally by the Framework. All this functionality is implemented through the use of standards compliant Web Services which are implemented by the Morfik compiler automatically based on your application objects and their configuration.

The compiler automatically generates Web Service standards compatible code for handling form opening, data page retrieval and such routine operations based on the objects that have been created in your application. This code makes full use of the Morfik Framework's pre-built infrastructure for handling remote calls, handling XML documents, serializing and deserializing objects from XML documents, etc. The Morfik Framework and compiler work together to allow the developer freedom from all these basic tasks.

Published and Non Published Tables and Queries

The Morfik Framework makes use of special Web Methods to allow read and write access to data sources such as Tables and Queries. These special Web Methods are created automatically by the Morfik compiler based on what objects are created within your project.

It is possible for Morfik to add information about these special Web Methods to the .WSDL file which is automatically created for your application every time it is compiled. This will allow other applications that may import your .WSDL file to make use of its Web Services interface to have access to these data sources.

Morfik allows you to choose if any of your data sources will be published, i.e. made visible to the external world through entries in the application .WSDL file, or not and if so if they will be published for read, write or read and write access. This is done through a pair of buttons that are visible in the Home tab of the ribbon when you are either in the Table Designer or the Query Designer, as shown in the following Figure.

Figure 1: Publishing options in the Home tab of the ribbon in either the Table or Query designer.

When one of the buttons is selected the corresponding kind of external access is registered for inclusion in the application's automatically generated .WSDL file. If you are not planning on implementing remote access to these data sources from another Morfik application you should leave them unpublished.

Database Updates

A very common use for Web Methods in Morfik applications is supporting data updates. While using the automatic navigation and data pagination of the Morfik Framework can make creating complex interfaces a simple proposition, there are certainly situations in which you might want to implement a single, central, code structure for updating your database. By having a single place from which you update your database information you can ensure that all appropriate consistency checks are done before actually submitting the update to the database. This will ensure that throughout your application data is updated in a consistent manner.

Accessing External Services

Many online service providers offer services through Web Services interfaces which you can harness in your Morfik application and integrate into its working. Morfik allows you to import the definition files for these services and thus "import" them into your project. With that done and whatever arrangements with the service provider in place, your application can start to access their services.

Two good examples of this kind of service are Amazon.com which offers several services through a Web Services interface and Salesforce.com, a leading provider of web-based customer relationship management software.

Salesforce.com makes virtually their entire application available for access through a Web Services interface. These and other services can be imported into a Morfik application in order to extend its functionality. Read more...

Related Topics

Back to top