Both of these approaches have their advantages and disadvantages.
You need to weigh these advantages and disadvantages to decide the approach.
For my usage, I found mix approach to be better (starting with WSDL and Java both).
Monica. Shiralkar wrote:
then what ever you are comfortable with based on what the use cases and diagrams suggest.
Thanks. Is it a question of just being comfortable with or there are other factors too why 2 ways exist to create Web services.
Since "web service" covers a HUGE number of possible applications from a simple lookup to an Amazon sized shopping site, there is no simplifying answer to your question. I would say there is a practically infinite number of paths to follow so pick what is comfortable for you.
Monica. Shiralkar wrote:There are 2 ways of creating a web service.?When should a web service be developed using code first method and when should we choose contract first method for developing the web services.?
Prefer to start with a well defined contract if you are starting from scratch. Code first approaches are usually done because there is already code written that is tested and working (usually already in production) and now needs to be integrated with some other applications via webservices.