TextReturnReader 类

定义

从使用 HTTP 实现但不支持 SOAP 的 Web 服务客户端的 HTTP 响应文本中读取返回值。Reads return values from HTTP response text for Web service clients implemented using HTTP but without SOAP.

public ref class TextReturnReader : System::Web::Services::Protocols::MimeReturnReader
public class TextReturnReader : System.Web.Services.Protocols.MimeReturnReader
type TextReturnReader = class
    inherit MimeReturnReader
Public Class TextReturnReader
Inherits MimeReturnReader
继承

注解

TextReturnReaderSystem.Web.Services.Protocols命名空间中的其他类通过 HTTP GET 和 http POST 操作支持 Web 服务的 .NET Framework 实现。TextReturnReader and other classes in the System.Web.Services.Protocols namespace support the .NET Framework's implementations of Web services via the HTTP-GET and HTTP-POST operations. Web 服务编写器和读取器分别在参数或返回 Web 方法的对象和 HTTP 请求或响应流之间进行序列化和反序列化。Web service writers and readers serialize and deserialize, respectively, between the parameters or return objects of Web methods and the HTTP request or response streams. Web 服务编写器和读取器使用 HTTP 进行传输, 但不使用 SOAP 标准交换消息。Web service writers and readers use HTTP for transport but don't exchange messages using the SOAP standard.

TextReturnReader类将非 XML 文本的客户端读取实现为 Web 方法返回值。The TextReturnReader class implements the client-side reading of non-XML text into Web method return values. 若要获取返回值, 则使用正则表达式模式匹配MatchAttribute(在 HTTP 响应正文中编码) 来分析文本, 该文本可应用于客户端代理类中的 Web 方法。To obtain a return value, the text, which is encoded in the body of an HTTP response, is parsed using regular expression pattern matching, as specified by the attribute MatchAttribute, which can be applied to a Web method in a client proxy class. TextReturnReaderPatternMatcher调用类以实际执行模式匹配。The TextReturnReader class calls the PatternMatcher class to actually perform the pattern matching.

文本模式匹配为 Web 服务提供了一种检索 HTML 内容的方式, 而无需将其转换为必须绑定到 XML 架构定义的 XML 文档。Text pattern matching provides a way for Web services to retrieve HTML content without converting it to XML documents that must be bound to XML Schema definitions. 正则表达式搜索目标是通过match元素中text的 XML 元素在 Web 服务描述语言 (WSDL) 文档中指定的。Regular expression search targets are specified in a Web Services Description Language (WSDL) document via match XML elements within text elements. 这两个元素属于命名http://microsoft.com/wsdl/mime/textMatching/空间。Both elements belong to the namespace http://microsoft.com/wsdl/mime/textMatching/.

如果在 WSDL 文档中指定了match元素, 则 wsdl.exe 工具会将特性MatchAttribute应用于生成的客户端代理类中的相应 Web 方法。When match elements are specified in a WSDL document, the Wsdl.exe tool applies MatchAttribute attributes to the corresponding Web methods in the client proxy class that is generated. 此外, TextReturnReader还用于XmlReturnReader替代的默认类, 用于根据 .NET Framework 的 web 服务实现, 通过 http GET 和 http POST 操作来返回值。Also, TextReturnReader is used in place of XmlReturnReader, the default class for deserializing Web method return values according to the .NET Framework's implementations of Web services via the HTTP-GET and HTTP-POST operations.

通常不需要直接使用TextReturnReader类。You typically will not need to use the TextReturnReader class directly.

构造函数

TextReturnReader()

初始化 TextReturnReader 类的新实例。Initializes a new instance of the TextReturnReader class.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetInitializer(LogicalMethodInfo)

返回指定方法的初始值设定项。Returns an initializer for the specified method.

GetInitializers(LogicalMethodInfo[])

在派生类中重写时,返回与方法定义的输入数组对应的初始值设定项对象的数组。When overridden in a derived class, returns an array of initializer objects corresponding to an input array of method definitions.

(继承自 MimeFormatter)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
Initialize(Object)

初始化一个实例。Initializes an instance.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
Read(WebResponse, Stream)

分析包含在 HTTP 响应中的文本。Parses text contained in the HTTP response.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅