This documentation is archived and is not being maintained.

WebClientProtocol.GetWebRequest Method

Creates a WebRequest instance for the specified uri. This protected method is called by the XML Web service client infrastructure to get a new WebRequest transport object to transmit the XML Web service request.

[Visual Basic]
Protected Overridable Function GetWebRequest( _
   ByVal uri As Uri _
) As WebRequest
protected virtual WebRequest GetWebRequest(
 Uri uri
protected: virtual WebRequest* GetWebRequest(
 Uri* uri
protected function GetWebRequest(
   uri : Uri
) : WebRequest;


The Uri to use when creating the WebRequest.

Return Value

The WebRequest instance.


Exception Type Condition
InvalidOperationException The uri parameter is a null reference (Nothing in Visual Basic).


This method can be overridden to customize the WebRequest object before the XML Web service request is made. For example you could add a custom header to the request.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

WebClientProtocol Class | WebClientProtocol Members | System.Web.Services.Protocols Namespace | WebRequest | GetWebResponse | HttpWebRequest | SoapHttpClientProtocol | Abort