Difference between SOA and Web Services

SOA and Web Services are two buzzwords in the software industry now a days. Most of the people are confused about, What they are?. And they dnt knw the difference, they take them as synonyms. Well I will try to clear the difference between these two.
Before going for the definition of SOA, we should atleast know what actually a service is ?

A Service is a unit of work done by a service provider to achieve desired end results for a service consumer. It represents a publicized package of functionality.

Both service provider and service consumer are the roles played by software agents on behalf of their owner.

A service is :

· Composeable

· Discoverable

The actual use of service is often based upon an agreed-upon contract with the provider, including in detail what is provided and what is the quality( availability, cost etc ) of the service.
Definition
SOA is an architectural style whose goal is to achieve loose coupling among interacting software agents.
Or
SOA is a specific architectural style that is concerned with loose coupling and dynamic binding between services.
A very good example of SOA, which I went through in one of the tutorial on http://webservices.xml.com is :
Take a CD for instance. If you want to play it, you put your CD into a CD player and the player plays it for you. The CD player offers a CD playing service. Which is nice because you can replace one CD player with another. You can play the same CD on a portable player or on your expensive stereo. They both offer the same CD playing service, but the quality of service is different.
The idea of SOA departs significantly from that of object oriented programming, which strongly suggests that you should bind data and its processing together. So, in object oriented programming style, every CD would come with its own player and they are not supposed to be separated. This sounds odd, but it’s the way we have built many software systems.

On the other hand, Web Services is an approach to realizing a SOA.

The World Wide Web Consortium (W3C), which has managed the evolution of the SOAP and WSDL specifications, defines Web services as follows:
A software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with XML serialization in conjunction with other Web-related standards.

Inspite of explaining each and every concept I will just present the architecture diagrams of the two

SOA :


Web Services is the base for implementing SOA and the Service bus is the centerpiece of this implementation. So here is the architecture of the Service bus.

Web Services :

The bottom (transport) layer presents its capabilities to cope with various transport protocols to communicate between a service and a requester. In case of web services you can transport messages by using the ubiquitous Web protocols such as HyperText Transport Protocol (HTTP) or Secure HTTP (HTTPS) to give the widest possible coverage in terms of support for the protocols, you can also transport them over any communications protocol.

The messaging layer on top of the transport layer enables the bus to deal with messages, both XML and non-XML. The latter is important, for example, if a requester and the service needed reside in the same J2EE application server and the bus can simply transport the data in its Java rendering, avoiding unnecessary transformations. The messaging services component of the framework contains the most fundamental Web services specifications and technologies, including eXtensible Markup Language (XML), SOAP, and WS-Addressing. Collectively, these specifications form the basis of interoperable messaging between Web services. XML provides the interoperable format to describe message content between Web services and is the basic language in which the Web services specifications are defined.

The next ( description )layer of the bus facilitates and deals with the description of services in terms of functions supported, quality of services of these functions, and supported binding mechanisms. This metadata is important, and it is fundamental to achieving the loose coupling that is associated with an SOA viz. WSDL, WS-Policy

The actual quality of services that the bus enforces based on appropriate parameterization via polices resides in the layer that follows. The specific issues involving this layer include security, reliability of message delivery, and support for transactions. Likewise web Services provides WS-Reliable Messaging, WS-Security.

The top layer represents the various kinds of virtual components that Web services represent. This layer has atomic services that are not composed as far as a requester’s experience with the service is concerned. Composite services that the service bus inherently supports are choreographies and societies of services that cooperate following an agreement protocol to decide on the success of the cooperation at the end of the cooperation.

Finally, another layer provides features for discovery of services and their descriptions and to agree on a mode of interaction between a requester and a service. UDDI and META-DATA Exchange are the ways it is done using web services.

Advertisements

Connect to SSL enabled database via JBoss

How to enable JBoss 4.2 to connect to a SSL enabled DATABASE

In my last post I explained how to enable SSL inJBoss. There may be a chance when you need to make your database to accept only SSL connections. In that case what you have to do is to put the appropriate datasource file into the deploy folder of your database. The point to make sure here is that mention the url in the database for ssl and not for simple.

I used JBoss-eap-as 4.2 and Postgres8.1

Copy the datasource file from

jboss-eap-4.2\jboss-as\docs\examples\jca

Or in you case it could be

jboss-as\docs\examples\jca

Into the deploy folder of your configuration.

jboss-eap-4.2\jboss-as\server\default\deploy

or

jboss4.x\server\default\deploy

Provide the connection url, username and password :

In case of postgres url is :

” <connection-url>jdbc:postgresql://ipaddress:5432/databasename?ssl=true&a m p;

sslfactory=org.postgresql.ssl.NonValidatingFactory&a m p;</connection-url> “

NOTE : DONT GIVE SPACE IN &a m p; OTHERWISE IT WILL NOT WORK, i HAVE TO DO THIS OTHER IT WILL NOT HAVE APPEARED IN THIS BLOG. THANX

Remember in this case there is no client-side authentication. In case you want to have a client-side authentication then you need to have a digital Certificate given by a certifying authority or you can either generate one for your self ( I have explained about how to generate a keystore in my previous post https://ravishbhupesh.wordpress.com/2008/05/06/enabling-ssl-on-jboss-2/ ).

ENJOY!

Enabling SSL on JBoss

How to enable SSL on JBoss 4.2

I am going to explain how to enable JBoss to accept SSL connection and also how to make JBoss to connect to a database which only accepts SSL connections.

I am using JBoss-eap-4.2 and Postgres8.1

My Postgres is configured to accept on SSL connections.

Firstly, lets enable ssl for jboss.

JBoss uses JSEE, the Java Secure Socket Extension (JSSE), for SSL. To start we need a public key/private key pair in the form of an X509 certificate for use by the SSL server sockets. Let us create a self-signed certificate using the JDK keytool. It was created using the following command and input:

keytool -genkey -keystore “NAME_OF_YOUR_KEYSTORE” -storepass “STOREPASS _OF_YOUR_KEYSTORE” –keypass “KEYPASS_OF_YOUR_KEYSTORE” -keyalg RSA -alias “ALIAS_OF_YOUR_KEYSTORE” -validity 3650 -dname

“cn=myKeystore,ou=jboss admin,dc=jboss,dc=org”

“NAME_OF_YOUR_KEYSTORE” = myKeystore.keystore

“NAME_OF_YOUR_KEYSTORE” = myKeystore

“STOREPASS_OF_YOUR_KEYSTORE” = rmi+ssl

“KEYPASS_OF_YOUR_KEYSTORE” = rmi+ssl

Finally it is :

keytool -genkey -keystore myKeystore.keystore -storepass rmi+ssl –keypass rmi+ssl -keyalg RSA -alias myKeystore -validity 3650 -dname”cn=myKeystore,ou=jboss admin,dc=jboss,dc=org”

You can view your keyStore file if you want to using this command

keytool -list -v –keystore myKeystore.keystore

Then copy the keystore file in the conf directory of ur jboss configuration.

jboss-eap-4.2\jboss-as\server\default\conf

in your case it could be

jboss4.x\server\default\conf

Now open the server.xml file in your conf directory :

jboss-eap-4.2\jboss-as\server\default\deploy\jboss-web.deployer

in your case it could be

jboss4.x\server\default\deploy\jboss-web.deployer

uncomment this block

<!–

<Connector port=”8443″ protocol=”HTTP/1.1″ SSLEnabled=”true”

maxThreads=”150″ scheme=”https” secure=”true”

clientAuth=”false” sslProtocol=”TLS” />

–>

And add these things

<Connector port=“THE_PORT_YOU_LIKE”

protocol=“HTTP/1.1” SSLEnabled=“true”

maxThreads=“150” scheme=“https”

secure=“true” clientAuth=“false”

keystoreFile=“${jboss.server.home.dir}/conf/THE_KEYSTORE_NAME”

keystorePass=“PASSWORD_FOR_THE_KEYSTORE”

truststoreFile=“${jboss.server.home.dir}/conf/THE_KEYSTORE_NAME”

truststorePass=“PASSWORD_FOR_THE_KEYSTORE”

sslProtocol=“TLS”/>

And it is done. Now start the jboss and type the url

https://ipaddress:8443 or https://localhost:8443

and its done.

If you don’t want to access your jboss server via 8080 port then you need to disable the connector 8080 in the server.xml file located at

jboss-eap-4.2\jboss-as\server\default\deploy\jboss-web.deployer

in your case it could be

jboss4.x\server\default\deploy\jboss-web.deployer