Introduction to SOA and middleware systems.

 1 : In SOA we have two or more software communicating with each other, in this guide we will consider two, namely Service consumer and Service provider. Consumer sends the request to the provider and provider send the response back to the consumer.

Service is a well-defined function that does not depend on the state of other services.

SOA is a solution for making two software communicate with each other. It is an architectural style for building business applications using loosely coupled services which act like black boxes and can be orchestrated to achieve a specific functionality by linking together.

Web service is an implementation of SOA.

 2 : The main characteristics of web service architecture is service provider publishes its service description and this description is placed in a certain directory which is in place. So all providers will put their service description in that directory and the consumer software can make queries against this directory to find out what services are available and how to communicate with the provider.

WSDL(web service definition language) : simply a language to create service description.

SOAP (simple object access protocol) : service provider will communicate with the directory using SOAP protocol in order to send its service description to the directory and consumer will query against this directory using the same protocol as well. SOAP is simply a protocol used by service provider and consumer software to talk to the directory.

XML : is a tag based language. Service consumer software will now formulate its message that needs to be sent to the provider software based on its service description. First consumer software will do the query against the database to find out which services are available and how to communicate with this provider, so based on the description written in WSDL and XML message will be formed. So this message that this consumer will be sending to the provider will be written in XML that is used between two software’s to communicate with each other. So consumer will formulate its message in XML , this message will go to the service provider. Service provider will generate its response back to the consumer and this response will be retrieved in XML as well. This response will be according to the specification will be stored in service description.

 3 :  Web services : There are two type of WS :  SOAP WS and REST WS. In java there are different specifications for both as JAX-WS and JAX-RS respectively. Website is made for human consumption, and the web services are made for application level consumption.

A web service is any piece of software that makes itself available over the internet and uses a standardized XML messaging system. XML is used to encode all communications to a web service. For example, a client invokes a web service by sending an XML message, then waits for a corresponding XML response. As all communication is in XML, web services are not tied to any one operating system or programming language–Java can talk with Perl; Windows applications can talk with Unix applications.

 Web Service Jargon:

WSDL(WebService definition language) : describes what a web service is, in an XML format that different technologies can understand, name of library, name of class, name of methods, available methods, return type, arguments all these information is available in service definition.  It is a document and available to all client who wants to use these webservices. WSDL (Web Services Description Language) is an XML based language which will be used to describe the services offered by a web service. WSDL describes all the operations offered by the particular web service in the XML format. It also defines how the services can be called, i.e what input value we have to provide and what will be the format of the response it is going to generate for each kind of service.

UDDI : Universal Description, Discovery and Integration :  all the web service providers registers their web services on a directory using WSDL file, it means service providers will provide a WSDL file to UDDI. And service consumer can request to access these web services, UDDI returns all the service providers offering that service. Then client chooses one service provider and gets WSDL file.

SOAP : a language, an XML format, a protocol  that is used to encode and decode messages. When you make a call to a web service it ends up as a SOAP message that gets transmitted over the network.

SEI : service endpoint interface : its an interface to the service end point, its an interface to the web service that provides the way for your client application irrespective of the technology, to call the web service. So depending on the technology you get a service endpoint interface for that technology. Java app has java service end point interface.

 Intro to Rest :REpresentational State Transfer:

REST guideline says that data and functionality which client can access on server are resources.  And each resource should be accessed by its URI by all the clients. In order to access a particular website, we paste address  of the website on the browser and gets some representation as a response. Client sends the request in order to access a particular resource which resides on the server, and the server will send back the response to the client. This response is the representation of a resource, which means a resource can be presented to the client in multiple formats like HTML, XML, plain text, PDF, JPEG, JSON etc.

There are 3 features in RESFUL web services. 1. Client can directly access the resources using URI, which is an advantage over SOAP WS, where client requires WSDL and stubs of SOAP ws in order to access anything on the server. 2. The response message received by client is self-descriptive. The message in itself would contain the information of format in which the client can read the response message. 3. Uniform interface.

REST commonly uses 4 HTTP methods as it uses HTTP protocol and not any other communication protocol, Get(Retrieve a resource), POST(Create a resource), PUT(update a resource), DELETE(Delete a resource)
Rest client can send messages using XML or JSON(JavaScript object Notation). Messages can be transferred with any HTTP method in Rest. Rest web services have no service definition.

REST is a stateless WS

It is an architecture that generally runs over HTP. Rest is an alternative to SOAP and instead of using XML for request REST uses simple URL in some cases. Unlike SOAP, RESTFUL applications uses HTTP build in headers to carry meta-information. There are various HTTP response codes that REST use to determine whether user has access to API or not like code 200 or 201 indicates successful interaction with response body while 400 indicates a bad request or the request URI does not match the APIs in the system.

 XSD : XML Schema Definition

Schema describes the structure of the document which describes what data is allowed in the document, what data is required in the document, what/how data is organized in the document.

XSD can also be used for generating XML documents that can be treated as programming objects. In general, a schema is an abstract representation of an objects characteristics and relationship to other objects. An XML schema represents the interrelationship between the attributes and elements of an XML objects. The process of creating a schema for a document involves analysing its structure and defining each structural element for a document encountered. For example, a schema for a document describing a website would defin a website element, a webpage element, and other elements that describe possible content divisions within any page on that site. Just as in XML and HTML, elements are defined within a set of tags. XSD is XML itself. Its purpose is to validate the structure of another XML document. You can define data type of the values of the nodes, you can also define custom data types for example month. You can put the restriction on the occurrence of the elements, using minOccurs and maxOccurs, the default values are 1  and 1.

XSLT : eXtensible Stylesheet Language Transformation
XSL (Extensible stylesheet language) is a styling language for XML.
XSLT is used to transform XML documents into other formats(like transforming XML into HTML, plain text or XSL formatting objects, which may subsequently be converted to other formats, such as PDF, PNG, etc).
The original document is not changed; rather a new document is created based on the content of an existing one. Typically, input documents are XML files, but anything from which the processor can build an XQuery and XPath Data Model can be used, such as relation database tables or geographical information system.

The XSLT processor takes one or more XML source documents, plus one or more XSLT Stylesheets, and processes them to produce an output document. XSL specifies a language definition for XML data presentation  and data transformations. Data presentation means displaying data in some forma and/or medium. Presentation is about style. Data transformation means parsing an input XML document into a tree of nodes, and then converting the source tree into a result tree. Transformation is about data exchange. Because these functionalities serve two distinct purposes, XSLT was proposed and later accepted as a separate standard for XML data transformation only. XSL is now generally referred to as XSL formatting objects(XSL-FO), to distinguish it from XSLT.

Middleware

http://stackoverflow.com/questions/2904854/what-is-middleware-exactly

Software that connects two otherwise separate applications. For example, there are number of middleware products that link a database system to a web server. This allows users to request data from the database using forms displayed on the a web browser, and it enables the web server to return dynamic web pages based on the users request and profile.

Typically, middleware programs provide messaging services so that different applications can communicate using message frameworks like SOAP, Rest and JavaScript Object Notation(JSON). The systematic tying together of disparate applications, often through the use of middleware is known as enterprise application integration.

At a basic level, middleware provides services required to connect applications together such as concurrency, transaction management, threading and messaging. More sophisticated implementations of middleware principles are baked into modern integration infrastructure

Middleware often sits between the operating system and applications on different servers and simplifies the development of applications that leverage services from other applications.

JMS – Java Messaging services

JMS  is an application program interface(API) that supports  the communication known as messaging between computers in a network. The message involved exchange crucial data between computers – rather than between users and contain information such as event notification ad service requests. Messaging is often used to coordinate programs in dissimilar systems or written different programming languages. JMS supports messages that contain serialized java objects and messages that contain XML pages.

JMS client : java application using JMS
JMS provider : messaging system that handles routing & delivery of messages
JMS Application :  Business system composed of many JMS clients and usually one JMS provider
Producer :  jms client sending messages.
Consumer :  jms client receiving messages.

 

JMS has two models:
1. Point to Point Queues : it is a one to one model, it can have many possible receiver, but it will be received by only one, and other cannot receive it.

2. Publish/Subscribe Topics :

There are two types of destination :  Topic and Queues.
Queue:  only one consumer receives the message.
Topic : Message will be delivered to all the subscribed consumers.