Creating Web Services with ASP.NET



Summary

The .NET Framework gives you an easy and powerful way to build Web services. You don't even need Visual Studio .NET to build them! This chapter discussed the following points:

  • .NET Web services are identified by a filename that ends in *.asmx.

  • WSDL is generated automatically, with a ?WSDL query request on the *.asmx file.

  • You can expose methods on a class as Web service operations by using the [WebMethod] attribute.

  • Using other attributes, you can control the style and use of the Web service operations.

  • Other attributes let you control the SOAP binding information as well as other pieces.

  • Faults are represented by the SoapException class. You can derive new classes from this type as well.

With technologies such as the .NET Framework and ASP.NET, building Web services is easy. Unlike other previous technologies such as DCOM or CORBA, the SOAP development environments for both .NET and Java have made exposing application logic much simpler. These technologies give the developer complete control over the SOAP messages that go in and out of a service, and with such control, designing and debugging a Web service become easy—making these technologies an obvious choice for distributed application development.