This documentation is archived and is not being maintained.

Creating WS-I Basic Profile 1.1 Interoperable Services

To configure a WCF service endpoint to be interoperable with ASP.NET Web service clients:

  • Use the System.ServiceModel.BasicHttpBinding type as the binding type for your service endpoint.

  • Do not use callback and session contract features or transaction behaviors on your service endpoint

You can optionally enable support for HTTPS and transport-level client authentication on the binding.

The following features of the BasicHttpBinding class require functionality beyond WS-I Basic Profile 1.1:

To make the metadata for a WCF service available to ASP.NET, use the Web service client generation tools: Web Services Description Language Tool (Wsdl.exe), Web Services Discovery Tool (Disco.exe), and the Add Web Reference feature in Visual Studio; you must enable metadata publication. For more information, see Publishing Metadata Endpoints.



The following example code demonstrates how to add a WCF endpoint that is compatible with ASP.NET Web service clients in code and, alternatively, in configuration files.


using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Description;

public interface IEcho
    string Echo(string s);

public class MyService : IEcho
    public string Echo(string s)
        return s;

class Program
    static void Main(string[] args)
        string baseAddress = "http://localhost:8080/wcfselfhost/";
        ServiceHost host = new ServiceHost(typeof(MyService), new Uri(baseAddress));

        // Create a BasicHttpBinding instance
        BasicHttpBinding binding = new BasicHttpBinding();

        // Add a service endpoint using the created binding
        host.AddServiceEndpoint(typeof(IEcho), binding, "echo1");

        Console.WriteLine("Service listening on {0} . . .", baseAddress);

      <service name="MyService" behaviorConfiguration="HttpGetMetadata">
        <endpoint address="echo2" contract="IEcho" binding="basicHttpBinding" />
        <behavior name="HttpGetMetadata">
          <serviceMetadata httpGetEnabled="true" />

See Also