[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Please help on Specified cast is not valid exception

Jeffrey Sanchez

8/4/2003 4:13:00 PM

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("code")]


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

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;

}

....