Building WS-I Basic Profile Compliant Web Services Using ASP.NET 2.0

This topic is specific to a legacy technology. XML Web services and XML Web service clients should now be created using Windows Communication Foundation.

ASP.NET 2.0 now supports the Web Services Interoperability Group (WS-I) Basic Profile (BP) 1.1 specification, which outlines a set of values that Web services can implement to interoperate with the widest possible number of Web service platforms.

The WS-I Basic Profile Version 1.1

Although XML Web services were developed using public specifications (XML, SOAP, and so on) to achieve the widest possible interoperation with Web services on different platforms, ambiguities in those specifications and differences in vendor implementations has slowed the development of widely interoperable Web services.

Version 1.1 of the WS-I Basic Profile specification is an attempt by a number of vendors to speed the deployment of truly interoperable Web services by removing ambiguities in specifications, describe clear limitations to compliant Web services, and choose a set of Web service settings from among a large number of possibilities. For details, see WS-I Basic Profile.

There are two steps to building BP-compliant Web services. First, define a service that conforms to the basic profile. Second, implement that service so that it supports the basic profile at run time. SOAP extensions, for example, can modify the contract at run time and break compliance.

To help developers ensure that a service is BP-compliant, the WS-I provides a number of testing tools.

Declaring a BP-Compliant SOAP 1.1 Port

In ASP.NET 2.0, you can instruct the ASP.NET run time to help enforce BP-compliance for the SOAP 1.1 port exposed by your service by applying the WebServiceBindingAttribute attribute to your Web service class and setting the ConformsTo property to BasicProfile1_1. (If the contract you develop is not BP-compliant, an exception is thrown at run time.) Provided you then implement a service that conforms to the WS-I Basic Profile, your service is BP-compliant and can be consumed by BP-compliant clients on any platform.

Note

By default, new Web services created by Visual Studio using version 2.0 of the .NET Framework are BP-compliant.

To publish a claim of BP-compliance in the Web Services Description Language (WSDL) file that describes your BP-compliant service, set the EmitConformanceClaims property to true. Setting the EmitConformanceClaims property to false suppresses the publication of BP-conformance in the WSDL for the Web service, but the SOAP port remains BP-compliant. (The WS-I Basic Profile 1.1 specification does not require the conformance claims to be published in WSDL.)

To see an example of a Web service that conforms to the WS-I Basic Profile 1.1 specification, see the BPConformance quick start sample in the ASP.NET Web Services QuickStarts.

Building a BP-Compliant Web Service

Creating and using a BP-compliant SOAP 1.1 port is only part of building a BP-compliant service. Because the WS-I Basic Profile 1.1 specification is an attempt to limit the flexibility of the Web service specifications in exchange for greater interoperability, do not build a service that does not conform to the WS-I Basic Profile 1.1 specification at run time. For example, services must not use RPC/encoded style messages. For a detailed list, see the see WS-I Basic Profile specification.

The following actions also break BP-compliance when developing your Web services using ASP.NET 2.0.

  • Using the DataSet.

  • Using the xml:lang attribute in the SOAP envelope.

  • Failing to use the new Order property when defining serializable types.

  • Returning null values in an RPC/literal Web service.

See Also

Other Resources

ASP.NET Web Services QuickStarts