Chapter 29. The System.Web.Services.ConfigurationNamespace
The System.Web.Services.Configuration
namespace contains
three .NET attributes that are useful if you want to add custom format extensions
to your web services (in other words, if you want to insert additional XML elements
to your web service’s WSDL service description). One practical reason to use a format
extension is if your web service requires a SOAP extension that runs at both the server
and the client end. By default, no information about SOAP extensions is added to the
service description, meaning that clients may not be aware that they need to use a given
extension (for example, a security or encryption extension) before they can use the web
service.
To use a format extension in this way, you need to start by deriving a custom class
from System.Web.Services.Description.ServiceDescriptionFormatExtension
, which represents the actual format extension. Next, you use the XmlFormatExtensionAttribute
in this namespace with the class to define the extension points where the extension should
apply. Optionally, you can use the XmlFormatExtensionPointAttribute
class with the custom format extension class to specify a member in the class that will act as a new extension point,
and the XmlFormatExtensionPrefixAttribute
to
set an XML namespace for the elements generated by the format extension.
Finally, you configure your format extension to run within the <serviceDescriptionFormatExtensionTypes>
section of the configuration ...
Get ASP.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.