UrlEncodedParameterWriter 类

定义

为使用 HTTP 实现但不支持 SOAP 的 Web 服务客户端提供传出请求参数编写器的 URL 编码功能。Provides URL encoding functionality for writers of out-going request parameters for Web service clients implemented using HTTP but without SOAP.

public ref class UrlEncodedParameterWriter abstract : System::Web::Services::Protocols::MimeParameterWriter
public abstract class UrlEncodedParameterWriter : System.Web.Services.Protocols.MimeParameterWriter
type UrlEncodedParameterWriter = class
    inherit MimeParameterWriter
Public MustInherit Class UrlEncodedParameterWriter
Inherits MimeParameterWriter
继承
UrlEncodedParameterWriter
派生

注解

UrlEncodedParameterWriterSystem.Web.Services.Protocols命名空间中的其他类通过 HTTP GET 和 http POST 操作支持 Web 服务的 .NET Framework 实现。UrlEncodedParameterWriter 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.

抽象UrlEncodedParameterWriter类继承自抽象MimeParameterWriter类, 将 Web 方法参数的客户端编写的 URL 编码功能添加到 HTTP 请求流中。The abstract UrlEncodedParameterWriter class inherits from the abstract MimeParameterWriter class, adding URL encoding functionality for client-side writing of Web method parameters into HTTP request streams.

通常不需要直接使用UrlEncodedParameterWriter或其子类。You typically will not need to use UrlEncodedParameterWriter or its descendant classes directly. 相反, 当 wsdl.exe 工具根据 HTTP GET 或 http POST 实现生成客户端代理代码时, 它会将应用HttpMethodAttribute于每个 Web 方法, 并将该ParameterFormatter特性的属性设置为相应的类型。Instead, when the Wsdl.exe tool generates client proxy code according to the HTTP-GET or HTTP-POST implementations, it applies the HttpMethodAttribute to each Web method and sets the attribute's ParameterFormatter property to the appropriate type.

备注

超文本传输协议-HTTP/1.1 指定使用多用途 Internet 邮件扩展 (MIME) 消息格式, 这种格式本身允许电子邮件指定不同的内容类型, 包括文本和二进制。The Hypertext Transfer Protocol--HTTP/1.1 specifies the use of a variation on Multipurpose Internet Mail Extensions (MIME) message format, which itself allows email messages to specify different content types, both text and binary.

构造函数

UrlEncodedParameterWriter()

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

属性

RequestEncoding

获取或设置用于将参数写入到 HTTP 请求的编码。Gets or sets the encoding used to write parameters to the HTTP request.

UsesWriteRequest

获取一个值,该值指示是否将 Web 方法参数值序列化到传出 HTTP 请求的正文中。Gets a value that indicates whether Web method parameter values are serialized to the out-going HTTP request body.

(继承自 MimeParameterWriter)

方法

Encode(TextWriter, Object[])

对 Web 方法的所有参数值进行编码,然后将它们写入指定编写器。Encodes all the parameter values for a Web method and writes them to the specified writer.

Encode(TextWriter, String, Object)

对指定参数值进行编码,然后将它写入指定编写器。Encodes a specified parameter value and writes it to the specified writer.

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)
GetRequestUrl(String, Object[])

在派生类中重写时,修改传出 HTTP 请求的统一请求定位符 (URL)。When overridden in a derived class, modifies the outgoing HTTP request's Uniform Request Locator (URL).

(继承自 MimeParameterWriter)
GetType()

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

(继承自 Object)
Initialize(Object)

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

InitializeRequest(WebRequest, Object[])

在派生类中重写时,初始化传出 HTTP 请求。When overridden in a derived class, initializes the out-going HTTP request.

(继承自 MimeParameterWriter)
MemberwiseClone()

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

(继承自 Object)
ToString()

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

(继承自 Object)
WriteRequest(Stream, Object[])

在派生类中重写时,将 Web 方法的参数值序列化到表示传出 HTTP 请求正文的流中。When overridden in a derived class, serializes Web method parameter values into a stream representing the outgoing HTTP request body.

(继承自 MimeParameterWriter)

适用于

另请参阅