Amrin
Amrin

Reputation: 1515

why to generate client code from wsdl for consuming webservice

In wsdl we have the information like Url , port number and method name every thing is described. We can communicate to the exposed method using those information then why we are using tool(Wsdl2Java) to generate client code(consumer code). and then use that client code to consume the webservice.

Upvotes: 1

Views: 328

Answers (2)

Amrin
Amrin

Reputation: 1515

Actually Consumer code generation(Using Wsdl2Java tool) is not mandatory if your exposed web method is taking primitive type as a parameter and return primitive type also . But if it is returning complex type like any object . that time The templet of object( Class of that Object) is nessary to be in client system. That class is also be generated while excuting WSDL2JAVE tool .

Upvotes: 0

ObscureRobot
ObscureRobot

Reputation: 7336

WSDL is a meta-language. It isn't executable code, but a tool used to help create executable code.

One of the advantages of defining a service in WSDL is that you can then implement the service and client in almost any language you want. Automated tools exist for generating clients and servers for popular languages, but you could write your own tool or hand-code your own implementation.

If you are the only person working on a web service, using an abstraction like WSDL may seem like a waste. In a team-oriented environment where many people and possibly several teams are working on services the WSDL abstraction makes it far easier for people to work together.

Upvotes: 1

Related Questions