I know that there are two ways of creating web services:
- Write wsdl first and generate j开发者_开发问答ava interface using web services tools like wsdl2java
- Write java code first and then use tool to generate wsdl.
For me, the first method looks complex and second looks quite easy relatively. If so, I want to know
- When is the first method used? Give me scenario where the first method is preferred over second.
- What is the advantage of first method over second?
- Which is the method which is widely used in industry for application programming?
- If I am looking for a job in web services development, is it necessary for me to know how to write wsdl file for given requirements.
Sometimes you need to declare the interface upfront before you have any implementation - for example you might have to negotiate it with the customer so that he can start coding against it ASAP. Then you start with WSDL.
If you don't need to have a WSDL representation as early as possible you can follow whatever procedure is convenient for you. For example, if you develop an ASP.NET web service it's quite convenient to just write C# code and have the runtime to generate the WSDL on consumer request.
精彩评论