HttpPostClientProtocol Class
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
The base class for XML Web service client proxies that use the HTTP-POST protocol.
Assembly: System.Web.Services (in System.Web.Services.dll)
System.MarshalByRefObject
System.ComponentModel.Component
System.Web.Services.Protocols.WebClientProtocol
System.Web.Services.Protocols.HttpWebClientProtocol
System.Web.Services.Protocols.HttpSimpleClientProtocol
System.Web.Services.Protocols.HttpPostClientProtocol
Name | Description | |
---|---|---|
![]() | HttpPostClientProtocol() | Initializes a new instance of the HttpPostClientProtocol class. |
Name | Description | |
---|---|---|
![]() | AllowAutoRedirect | Gets or sets whether the client automatically follows server redirects.(Inherited from HttpWebClientProtocol.) |
![]() | CanRaiseEvents | Gets a value indicating whether the component can raise an event.(Inherited from Component.) |
![]() | ClientCertificates | Gets the collection of client certificates.(Inherited from HttpWebClientProtocol.) |
![]() | ConnectionGroupName | Gets or sets the name of the connection group for the request.(Inherited from WebClientProtocol.) |
![]() | Container | Gets the IContainer that contains the Component.(Inherited from Component.) |
![]() | CookieContainer | Gets or sets the collection of cookies.(Inherited from HttpWebClientProtocol.) |
![]() | Credentials | Gets or sets security credentials for XML Web service client authentication.(Inherited from WebClientProtocol.) |
![]() | DesignMode | |
![]() | EnableDecompression | Gets or sets a value that indicates whether decompression is enabled for this HttpWebClientProtocol. (Inherited from HttpWebClientProtocol.) |
![]() | Events | |
![]() | PreAuthenticate | Gets or sets whether pre-authentication is enabled.(Inherited from WebClientProtocol.) |
![]() | Proxy | Gets or sets proxy information for making an XML Web service request through a firewall.(Inherited from HttpWebClientProtocol.) |
![]() | RequestEncoding | The Encoding used to make the client request to the XML Web service.(Inherited from WebClientProtocol.) |
![]() | Site | |
![]() | Timeout | Indicates the time an XML Web service client waits for the reply to a synchronous XML Web service request to arrive (in milliseconds).(Inherited from WebClientProtocol.) |
![]() | UnsafeAuthenticatedConnectionSharing | Gets or sets a value that indicates whether connection sharing is enabled when the client uses NTLM authentication to connect to the Web server that hosts the XML Web service.(Inherited from HttpWebClientProtocol.) |
![]() | Url | Gets or sets the base URL of the XML Web service the client is requesting.(Inherited from WebClientProtocol.) |
![]() | UseDefaultCredentials | Gets or sets a value that indicates whether to set the Credentials property to the value of the CredentialCache.DefaultCredentials property.(Inherited from WebClientProtocol.) |
![]() | UserAgent | Gets or sets the value for the user agent header that is sent with each request.(Inherited from HttpWebClientProtocol.) |
Name | Description | |
---|---|---|
![]() | Abort() | Cancels a request to an XML Web service method.(Inherited from WebClientProtocol.) |
![]() | BeginInvoke(String, String, Object[], AsyncCallback, Object) | Starts an asynchronous invocation of a method of an XML Web service.(Inherited from HttpSimpleClientProtocol.) |
![]() | CancelAsync(Object) | Cancels an asynchronous call to an XML Web service method, unless the call has already completed.(Inherited from HttpWebClientProtocol.) |
![]() | CreateObjRef(Type) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.) |
![]() | Dispose() | |
![]() | Dispose(Boolean) | |
![]() | EndInvoke(IAsyncResult) | Completes asynchronous invocation of an XML Web service method using HTTP.(Inherited from HttpSimpleClientProtocol.) |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetLifetimeService() | Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.) |
![]() | GetService(Type) | |
![]() | GetType() | |
![]() | GetWebRequest(Uri) | Creates a WebRequest instance for the specified URI.(Overrides HttpWebClientProtocol.GetWebRequest(Uri).) |
![]() | GetWebResponse(WebRequest) | Returns a response from a synchronous request to an XML Web service method.(Inherited from HttpWebClientProtocol.) |
![]() | GetWebResponse(WebRequest, IAsyncResult) | Returns a response from an asynchronous request to an XML Web service method.(Inherited from HttpWebClientProtocol.) |
![]() | InitializeLifetimeService() | Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.) |
![]() | Invoke(String, String, Object[]) | Invokes an XML Web service method using HTTP.(Inherited from HttpSimpleClientProtocol.) |
![]() | InvokeAsync(String, String, Object[], SendOrPostCallback) | Invokes the specified method asynchronously.(Inherited from HttpSimpleClientProtocol.) |
![]() | InvokeAsync(String, String, Object[], SendOrPostCallback, Object) | Invokes the specified method asynchronously while maintaining an associated state.(Inherited from HttpSimpleClientProtocol.) |
![]() | MemberwiseClone() | |
![]() | MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object.(Inherited from MarshalByRefObject.) |
![]() | ToString() |
When an XML Web service client uses the HTTP-POST protocol, by default parameters are encoded within the HTTP body using URL encoding rules and uses plain XML for the response. This protocol uses classes that derive from MimeFormatter to encode parameters and return values into standard MIME formats. The encoders to use are specified in the service description.
If you are building an XML Web service client using ASP.NET, then a proxy class deriving indirectly or directly from WebClientProtocol needs to be created for the XML Web service you want to call. When the XML Web service client is calling using HTTP, derive the proxy class HttpSimpleClientProtocol, which in turn derives from WebClientProtocol.
HttpGetClientProtocol and HttpPostClientProtocol derive from HttpSimpleClientProtocol, providing the support for calling an XML Web service method using HTTP-GET and HTTP-POST respectively. Clients calling an XML Web service using SOAP should derive from SoapHttpClientProtocol.
For details on building a proxy class, see [<topic://cpconcreatingwebserviceproxy>].
The following example is a proxy class generated by the Wsdl.exe utility for the Math XML Web service below. The proxy class derives from HttpPostClientProtocol, which derives from the abstract HttpSimpleClientProtocol class.
using System.Diagnostics; using System.Xml.Serialization; using System; using System.Web.Services.Protocols; using System.Web.Services; public class MyMath : System.Web.Services.Protocols.HttpPostClientProtocol { [System.Diagnostics.DebuggerStepThroughAttribute()] public MyMath() { this.Url = "http://www.contoso.com/math.asmx"; } [System.Diagnostics.DebuggerStepThroughAttribute()] [System.Web.Services.Protocols.HttpMethodAttribute(typeof(System.Web.Services.Protocols.XmlReturnReader), typeof(System.Web.Services.Protocols.HtmlFormParameterWriter))] [return: System.Xml.Serialization.XmlRootAttribute("int", Namespace="http://www.contoso.com/", IsNullable=false)] public int Add(string num1, string num2) { return ((int)(this.Invoke("Add", (this.Url + "/Add"), new object[] {num1, num2}))); } [System.Diagnostics.DebuggerStepThroughAttribute()] public System.IAsyncResult BeginAdd(string num1, string num2, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("Add", (this.Url + "/Add"), new object[] {num1, num2}, callback, asyncState); } [System.Diagnostics.DebuggerStepThroughAttribute()] public int EndAdd(System.IAsyncResult asyncResult) { return ((int)(this.EndInvoke(asyncResult))); } }
The following example is the Math XML Web service, from which the previous proxy class was created.
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.