Patterns for Using Web Services in Morfik
From Morfikwiki.com
Contents |
[edit] Using Web Services in a Morfik 07 XApp.
Morfik WebOS AppsBuilder allows developers to both publish and consume Web Services. In Morfik 07, the publishing of Web Services, though adhering to industry standards, imposes limitations on the type of parameters (specifically, structured/complex types) that a web services call can accept. Despite this limitation, Morfik offers an extremely easy entrance path to the world of Web Services and Services Oriented Architecture (SOA).
Morfik offers an easy way for the uninitiated to brave new frontiers, through the concept of a Web Method which is a function/method which is published through Web Services Standards.
All Morfik Applications (XApps) are inherently Web Services compliant servers, in their server side components. The Morfik Framework actively uses Web Services calls to implement all of its high level communication between the server and browser sides of Morfik XApps.
Since browsers will not allow JavaScript code downloaded from domain A to make a call to a server in domain B, for security reasons, Morfik 07 only allows calls to external Web Services to originate from the server side of the XApp. Calls between the browser and server portions of an XApp are considered to be a special case and the developer can create WebMethods which will be callable from the browser side through the RunWebMethod command.
There are two basic scenarios for usage of Web Services in a Morfik 07 application, with two possible variations in one of them.
[edit] Scenario 1
Intra-application calls from the browser to services offered by the server side portion of an XApp. In this scenario we are considering that the application/site which is running in the browser is part of the same Morfik XApp as the server side code.
[edit] Scenario 2
Calls to Web Services external to the application, implemented in another Morfik XApp (scenario 2a) or any other source (scenario 2b). These calls are started on the Server side of an XApp, sometimes in response to a an intra-application call from the browser side, as described in Scenario 1.
| Scenario 2a | Scenario 2b |
[edit] Using Web Services in an Morfik R2 XApp
Morfik AppsBuilder R2 offers an extended range of scenarios for the usage of Web Services and for building the blocks which will be part of a SOA environment.
Among the major differences between Morfik AppsBuilder R2 and Morfik 07 is the removal of limitations in the building of industry standards compliant web services server applications and the possibility of initiating a web services call directly from within the browser (scenario 3).
[edit] Scenario 3
A single browser XApp calls directly web services provided by two (or more) different servers within the same domain it was served from (scenario 3a).
Scenario 3a
One of the servers which is being called directly can make a call to an external service, provided by a server in another domain (scenario 3b).
Scenario 3b
[edit] Scenario 4
The process of creating "proxies" to external web services (as described in scenario 3b) is automated. This allows Web Services to be easily called from browser XApps through a server XApp proxy.
In this scenario the logical communication is between the browser XApp and an external web service. This is impossible to implement without a server component due to browser security restrictions. Morfik AppsBuilder R2 automates the process of creating proxies for this type of situation and allows the developer to code the application as if the call was actually originating on the browser.
[edit] Scenario 5
The all-you-can-code web services scenario. It includes all the possibilities that are covered in scenarios 1 to 4 and shows that they can be used in conjunction to create sophisticated web applications and websites.
[edit] Conclusion
The changes in the Morfik Framework introduced in Morfik R2 to fully support all aspects of creating industry standards compliant web service servers have been tailored to make the creation of such servers easier and faster. Using Morfik R2 it is now much faster and practical to publish web services, allowing developers to, very quickly, create applications which publish their services. These changes will attract the attention of developers and should result in a higher number of applications so exposing their services.







