Please help on Specified cast is not valid exception

  • Thread starter Jeffrey Sanchez
  • Start date
J

Jeffrey Sanchez

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.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;

}

....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top