Configuring a Web Service to Run with WSE

In order to run a Web service with the WSE, a WebServicesExtension class must be configured to run with the Web application hosting the Web service. The WebServicesExtension class intercepts the SOAP messages sent to Web services within the Web application and processes the SOAP headers it recognizes. Those SOAP headers are the following, defined in the subset of the Web services architecture supported by WSE: WS-Security, WS-Routing, WS-Timestamp, and DIME.

Specifying that a Web service is WSE enabled

  • In the Web.config file for the Web application hosting the Web service, include an <add> Element for <soapExtensionTypes> (WSE for Microsoft .NET) element in the <soapExtensionTypes> section.
    The following code example is the configuration entry that must be placed in the Web.config file for WSE to run with a Web service. The type attribute of the <add> Element for <soapExtensionTypes> (WSE for Microsoft .NET)must be on one line, even though the following example shows it split across multiple lines for readability.

    <configuration>
       <system.web>
          <webServices>
             <soapExtensionTypes>
                <add type="Microsoft.Web.Services2.WebServicesExtension, Microsoft.Web.Services2,Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                       priority="1" 
                       group="0"/>
             </soapExtensionTypes>
          </webServices>
       </system.web>
    </configuration>
    

    Note

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

See Also

Concepts

Configuring a SOAP Message Router with WSE

Other Resources

Managing Applications Created with WSE