0

Do we need a WSDL file for making a SOAP web service, and use the same WSDL for clients? Or, do we create classes for the web service and use them to automatically generate the WSDL for clients?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Farhadix
  • 1,395
  • 2
  • 12
  • 25
  • What's the difference for the client? They download the WSDL and execute the mentioned operations with the data structures. – Sven Aug 10 '14 at 22:30

1 Answers1

0

What you are referring to is the difference between contract-first and contract-last.

Contract-first means you create a WSDL that describes the operations of the web service and then you use the WSDL to build a code skeleton for the web service.

Contract-last means you write the web service code skeleton first and then let the framework generate the WSDL from that code.

Either way the result is the same: you have a WSDL to give to your clients to generate code stubs and you have the server side code to go along with that WSDL.

Creating the WSDL by hand gives you more control over its content and you don't even need to have any web service code behind it (i.e. you can build the service and clients in parallel). But most developers don't want to build one because that's just plumbing needed to get the message on the wire; they don't want to waste time with that but concentrate instead on building the web service itself.

Bottom line is you can choose whatever style you like depending on your skill set, needs, constraints or preference.

Community
  • 1
  • 1
Bogdan
  • 23,890
  • 3
  • 69
  • 61