Search code examples
asp.netweb-serviceswsdlasmx

What is the use of the /serverInterface and /server option for the WSDL.exe tool


All, Generally.With the asp.net tool WSDL.exe tool, I think there are three ways to generate asp.net code from the wsdl file.

  1. default output to generate client proxy class.
  2. generate abstract class code.(add /server option)
  3. generate interface code.(add /serverInterface)

In my understanding the 1 is generating a client proxy class which can help handle the request and response for or from the web services for the client side.

As to the 2 and 3 ,I believe actually they are used to generate code for the server side when you want to implement your own web services from the generated abstract class or interface .

But I am not sure whether my understanding is right . hope someone who is familiar with it can help to verify it . If it is not right, please correct me .thanks.


Solution

  • Firstly, as John has already said use WCF if possible.

    You are correct however, the /server and /serverinterface are used to generate code for the server-side components when you have an existing WSDL document for a web service.

    Although for many ASP.Net developers the web service implementation comes first and is used to produce the WSDL it can be that you have an existing WSDL document for a web service that you need to implement in ASP.Net, for example a legacy web service that is being migrated to a new platform. In this case those two switches are used to help produce a web service which is compatible with the existing WSDL so that clients may use your ASP.Net web service without needing to re-consume the WSDL (which often requires a code change in that client).

    I myself have used this feature before to create stub web services for testing purposes when I have the WSDL for a web service however it is not possible to test against the actual web service implementation.