Updated 2015-11-11 08:20:49 by aspect (Redirected from WS)

A Web Service is a service that is hosted inside a webserver and which communicates by messages encoded within some higher protocol (usually HTTP). The two major classes of web service are the SOAP-based services and the RESTful services; they have substantially different theories behind them.

SOAP  edit

SOAP services communicate by messages, which approximate to service calls. The messages are usually conveyed as the XML body of an HTTP POST (or its response) and consist of an envelope that contains a header part and a body part. The header is used to convey meta-information such as message routing info or security tokens. The body holds the “content” of the message, or can be a fault (i.e., an exception/error). SOAP messages can be conveyed by other mechanisms (e.g., SMTP or XMPP) though these are relatively rare by comparison with HTTP.

SOAP services are typically described in WSDL, a comprehensive and heavyweight language with support for many optional features and enormous depth of complexity.

The most popular package for SOAP in Tcl is TclWS, available at http://core.tcl.tk/tclws/

REST  edit

REpresentational State Transfer, REST services are tightly coupled to HTTP, and are characterized by conceiving of the service as a collection of resources that can have simple operations applied to them (the HTTP verbs, such as GET, POST, PUT, and DELETE). Resources refer to each other by URLs; RESTful clients are not supposed to synthesize their own URLs at all. Some operations are performed by using HTTP content negotiation to arrange for different representations of the resources to be transferred. It's common for REST applications to support XML for the content type of their messages as it has tremendous richness of inline metadata, but other types (notably JSON) are also frequently used.

Some REST services are described in WADL, but they are generally expected to be at least partially self-describing. Theoretically they can be described by WSDL, but this is rare in practice.

tcllib includes a REST package

Discussion edit

See also  edit

  • http://c2.com/cgi/wiki?WebServices .
  • Article on programming web services in a scripting language [2]
  • SOAP
  • WSDL
  • WebServices
  • Leela is an XOTcl-based Web Service infrastructure for loosely-coupled business services. Each peer is controlled in one or more federations. Within this environment peers can collaborate in a simple-to-use, loosely coupled, and ad hoc style of communication.