Hi there!

Does anybody know how to override GetWebRequest Method when using WSE on
reference.cs.

I get a "Specified cast is not valid exception" when running my app.

Here is the code I'm trying to implement:

....

using System.Net;

using Microsoft.Web.Services;

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.ComponentModel.DesignerCategoryAttribute("c ode")]


[System.Web.Services.WebServiceBindingAttribute(Nam e="clssaeExpedienteWSSoap
", Namespace="http://tempuri.org/")]

public class clssaeExpedienteWS :
Microsoft.Web.Services.WebServicesClientProtocol {

protected override WebRequest GetWebRequest(Uri uri)

{

HttpWebRequest webRequest = (HttpWebRequest)
base.GetWebRequest(uri); I get a "Specified cast is not valid" in this
line when running



webRequest.KeepAlive = false;

return (WebRequest) webRequest;

}

....