If I have to design a web based application, accessible only in an intranet environment. Is it a good idea to use web services as data access layer ? For example: for a customer data entry screen - I'll have web services like : getCustomerbyIDWS(), IsCustomerUniqueWS(), AddCustomerWS(), UpdateCustomerWS() etc. It just sounds to me like an overhead to use web services. Appreciate your responses.
What you're proposing seems to be providing a Web Services (i.e. SOAP) interface into a database.
This is certainly possible - I've seen it done a few times.
You're going to need a little bit more that a data access layer.
An incoming SOAP message needs to be converted into RMI (using a SOAP stack - protocol coverter like Cape Clear). This is passed to the data access/ persistence tier that updates the database. The data persistence layer should be based on Data Access Objects (DAOs) and there's a wide variety of technologies available (JDBC, JDO, Hibernate, EJB CMP).
The good news is that there's tools available to generate everything you need. Tools lkie FireStorm/DAO generate DAOs directly from a database schema. The DAO classes are stateless services that can easily be exposed as transactional Session Beans and are also suitable for use as part of a Web Services architecture. There's lots of tools available to generate WSDL from Java classes, such as Cape Clear.
It just sounds to me like an overhead to use web services.
I would certainly agree. To use web services for an intranet application as you have described is complete overkill, in my opinion. You will add cost and complexity to the appplication for no benefit - indeed, it will run slower than every other solution I can think of.
Remember, web services can be a good solution for inter-system communications. In my company, we are use web services for interfacing applications written inhouse, partly to decouple them from each other.
But I've seen applications where web services was used internally, and I could see no benefit at all. For these applications, what's wrong with passing objects around? And if the client is remote, then RMI or EJB (which uses RMI-IIOP) would often be best.