HTML Text Pattern Matching
This example demonstrates how to create a client proxy for any URI that serves up text. Instead
of authoring the .asmx file, you can create a WSDL file that describes an HTML
(or XML or any other nonbinary format) page you currently offer. The WSDL can be
used to generate a client proxy, using the WSDL.exe command line tool that
will use RegEx to parse the named HTML page and extract values.
You can do this by adding <Match> tags in the Response section of the WSDL. These
tags take an attribute called pattern, which is the Regular Expression that
corresponds to the piece of text on the page that is the property's value. (Note: the
property from the proxy class is read-only.)
The consuming code can then create the object, access the Matches object that is
returned by the functioned name in the WSDL, and gain access to any piece of
the HTML as a property. No understanding of WSDL, regular expressions, or even HTML is
needed to use the proxy class. It behaves like any other .NET Framework class would.
Copyright 2001 Microsoft Corporation. All rights reserved.