Web Services: Difference between revisions
Cat WIP |
m Extending |
||
Line 14: | Line 14: | ||
==VDF Implementation== | ==VDF Implementation== | ||
Within Visual DataFlex, Web Services are implemented through two mechanisms: one for creating '''services''' and the other for creating '''clients'''. | Within Visual DataFlex, Web Services are implemented through two mechanisms: one for creating '''services''' and the other for creating '''clients''' of existing services. | ||
===VDF Web Services=== | ===VDF Web Services=== | ||
Line 21: | Line 21: | ||
In the Web Service Object (which will have a source file extension of ".wo") you then create methods ([[Function]]s and/or [[Procedure]]s), which you will subsequently [[Web_Service_Basics#Publishing_an_Operation|publish]] as your service's '''''operations'''''. | In the Web Service Object (which will have a source file extension of ".wo") you then create methods ([[Function]]s and/or [[Procedure]]s), which you will subsequently [[Web_Service_Basics#Publishing_an_Operation|publish]] as your service's '''''operations'''''. | ||
By default [[Visual DataFlex]] publishes [http://www.ibm.com/developerworks/webservices/library/ws-docstyle.html Document Style] web services and unless you have a pressing reason to use the alternative ([http://en.wikipedia.org/wiki/Remote_procedure_call RPC] Style) you should adhere to this. This means that, except in the simplest cases (such as the much-cited example of serving up a stock price), you will need to [[Web_Service_Basics#Defining_XML_Documents|define the documents]] which are to be passed to and from the service's operations. | By default [[Visual DataFlex]] publishes [http://www.ibm.com/developerworks/webservices/library/ws-docstyle.html Document Style] web services and unless you have a pressing reason to use the alternative ([http://en.wikipedia.org/wiki/Remote_procedure_call RPC] Style) you should adhere to this (it can be changed by setting the ''peSoapStyle'' property to ''ssRPC''). This means that, except in the simplest cases (such as the much-cited example of serving up a stock price), you will need to [[Web_Service_Basics#Defining_XML_Documents|define the documents]] which are to be passed to and from the service's operations. These are defined as extended data-types - structs and arrays - which can be combined to produce documents of arbitrary complexity. | ||
===VDF Web Service Clients=== | ===VDF Web Service Clients=== | ||
===Further Topics=== | |||
* Synchronous vs. Asynchronous | |||
* Granularity | |||
* Loose Coupling | |||
* Reliablility | |||
* Security | |||
* Management | |||
* Orchestration (what tom-cats hate! <g>) | |||
* Choreography | |||
* Composition | |||
* Taxonomies and Semantics | |||
---- | ---- |
Revision as of 22:10, 7 April 2008
Web Services page under construction
Definition
Web Services are usually defined as "A standard means of interoperating between different software applications, running on a variety of platforms and/or frameworks" [1]. While many possible mechanisms could be found to satisfy this definition, in practice Web Services today (Nov 2007) are commonly implemented using two XML protcols: SOAP - the actual message formatting protocol - and WSDL - the service definition protocol. Again, many low-level transmission mechanisms might be employed to facilitate the message exchange, but in practice almost all common implementations utilise the HTTP protocol and it's POST request.
Web Service Protocols
The "vanilla" XML SOAP+WSDL over HTTP web services implementation can be thought of as the core of an entire stack of protocols relating to web services.
Early visions for web services called for dynamic discovery of, and connection to, web services, details of which were to be located in a UDDI (Universal Description, Discovery and Integration - see also [2]) repository. More recently (as of Nov 2007) however, UDDI has faded from view as it has become increasingly clear that it was somewhat ahead of its time. As the web services environment matures it may re-emerge, or some other discovery mechanism might be implemented to take its place. Currently most web service connections are statically bound, not dynamically discovered.
There are also a whole raft of additional protocols (not all of which are strictly in the same class as formal protocols like SOAP and WSDL), usually beginning "WS-". Examples are WS-Reliability, WS-ReliableMessaging (these two are competing standards: the latter, backed by Microsoft and IBM, looks the likely winner), WS-Security, WS-Policy, and so on.
Don't worry if you have missed the latest emerging web service standard - there will be another one along in a minute!
VDF Implementation
Within Visual DataFlex, Web Services are implemented through two mechanisms: one for creating services and the other for creating clients of existing services.
VDF Web Services
Visual DataFlex's Web Service mechanism relies on having Microsoft's IIS (Internet Information Services) running on the "server" machine. A service is developed by first creating a WebApp project (program) within the Workspace (if one does not already exist - it is always named "WebApp" and there can be only one such in any Workspace), then creating a Web Service object which will be deployed within it.
In the Web Service Object (which will have a source file extension of ".wo") you then create methods (Functions and/or Procedures), which you will subsequently publish as your service's operations.
By default Visual DataFlex publishes Document Style web services and unless you have a pressing reason to use the alternative (RPC Style) you should adhere to this (it can be changed by setting the peSoapStyle property to ssRPC). This means that, except in the simplest cases (such as the much-cited example of serving up a stock price), you will need to define the documents which are to be passed to and from the service's operations. These are defined as extended data-types - structs and arrays - which can be combined to produce documents of arbitrary complexity.
VDF Web Service Clients
Further Topics
- Synchronous vs. Asynchronous
- Granularity
- Loose Coupling
- Reliablility
- Security
- Management
- Orchestration (what tom-cats hate! <g>)
- Choreography
- Composition
- Taxonomies and Semantics
Original Article
(will be removed when the above is complete)
Cornerstone of a modern service oriented architecture
Visual DataFlex Studio has a tool to use a Web Service class from dataflex code ( VDF Webservice Class )
The generated webservice client may use Call By Reference to return results.
Coding webservices
Usually , when coding webservices there are two approaches - "contract first" and "model first".
When using "Contract first" you usually get a WSDL file that your webservice must adhere to. When using "Code first" you typically write the code first and use a tool to generate the WSDL from the code.
The standard approach using Visual DataFlex is to use "code first".