How to: Configure a Web Service to Use WSE

To use WSE with a Web service, a WseProtocolFactory class must be configured to run with the Web application that is hosting the Web service. The WseProtocolFactory class intercepts SOAP messages that are sent to Web services within the Web application to process the WS-* specifications SOAP headers that WSE recognizes. For a list of WS-* specifications that WSE supports, see Web Service Specifications Supported by WSE.

To specify that a Web service is WSE enabled

  • In the Web.config file for the Web application that is hosting the Web service, include a <soapServerProtocolFactory> Element element in the <webServices> section.

    1. In Solution Explorer, right-click the project name, and then click WSE Settings 3.0….
    2. Select the Enable this project for Web Services Enhancements check box.

    The following code example shows the configuration entry that the WSE Settings 3.0 Tool adds to the Web.config file. The type attribute of the <soapServerProtocolFactory> Element must be on one line, even though the following example shows it split across multiple lines for readability.

    <configuration>
       <system.web>
            <webServices>
                <soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
            </webServices>
       </system.web>
    </configuration>
    

    Note

    For this configuration entry to work, the Microsoft.Web.Services3 assembly must be accessible from within this Web application. Therefore, the Microsoft.Web.Services3 assembly must be in the global assembly cache. When WSE is installed, it is placed in the global assembly cache by default.

See Also

Reference

<soapServerProtocolFactory> Element

Other Resources

Creating a WSE-enabled Web Service