Web Services In Talend


Web services are to computers what a browser is to a human, allowing  programs to interchange information via an interface accessed via a URL. By promoting modular development removing application logic to a separate unit, web services help to reduce tight coupling with associated benefits in maintainability. They do have a downside introducing multiple possible points of failure to a system and the true benefit must be evaluated as part of the design process,

Two main types of web service exist: simple object access protocol or SOAP and representational state transaction or REST.

SOAP is the older technology and works by sending an XML packet in a defined format to a URL. The packet is consumed and the service returns a response XML package which can be parsed by the client. Services refer to a file written in a special dialect of XML known as web services definition language or more commonly termed WSDL file. This represents a contract defining the operations handled by the service including input and output definitions. The existence of the WSDL file enables software packages such as Talend to automatically generate stub procedures to implement the defined operations.

REST, the newer technology is actually a programming style rather than a protocol which means the implementation may vary considerably between applications. There are a number of white papers exploring the origins of REST and it’s original purpose but in general use we can think of it as CRUD operations through remote procedure calls over HTTP, the primary verbs being GET and PUT. REST is not designed to fully replace SOAP rather a lightweight framework to be used when the robust features of SOAP are not required.

Within Talend both types of service use the Apache CXF framework which is installed into the OSGI container used by Karaf via Camel CXF bundles as part of the Camel integration when installing Talend runtime. The setup includes the installation of jax-ws and jax-rs api’s for SOAP and REST services respectively and an embedded Jetty server to run the services. Web services are developed using components from the ESB pallete.

There are a couple of freely available tools that will help significantly with both development and testing:

https://notepad-plus-plus.org/downloads/

Notepad++ is a text editor that supports a wide range of languages and formats via plug ins. Install the XML Tools option and this add fully featured xml formatting and validation operations to the package.

https://www.soapui.org/downloads/soapui/

SOAPUI allows the creation of projects to test both SOAP and REST services by generating stubs for the operations and can also be used to create mock services. As it’s name implies it was developed for SOAP services but it can also be used for REST services although generally these can be tested directly in a browser.