Error consuming HTTPS Web Service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?VGFoYQ==?=

    Error consuming HTTPS Web Service

    I am working on a C#.Net application that consumes a web service developped
    (by others) in Java.

    My application calls a web method to post a 64-bit binary file to the web
    service.

    The operation succeeds when using HTTP regardless of file size. However, we
    need to use HTTPS, but I can only get a tiny file through with HTTPS.
    Anything bigger than (probably) 10 KB, and I get this error:

    The underlying connection was closed: An unexpected error occurred on a send.

    I am using Visual Studio 2005 / .Net Framework 2.0 SP1, but I also tried it
    with Visual Studio 2008 / .Net Framework 3.5 SP1.

    I basically created a web reference from a wsdl file and which generated a
    Reference.cs file. Then I make calls to the class in that file.

    I have researched this issue and got several suggested workaround already
    implemented to no avail. Here are the workaround in place:

    1. Accept any SSL certificate. I used this line of code which calls a
    function that always returns true:

    ServicePointMan ager.ServerCert ificateValidati onCallback =
    ValidateServerC ertificate;

    2. Changed KeepAlive to false by adding the following function in the
    reference.cs:

    protected override System.Net.WebR equest GetWebRequest(U ri uri)
    {
    System.Net.Http WebRequest webRequest =
    (System.Net.Htt pWebRequest)bas e.GetWebRequest (uri);
    webRequest.Keep Alive = false;
    System.Windows. Forms.MessageBo x.Show(uri.ToSt ring());
    return webRequest;
    }

    Any other suggestions? Please help.

    Taha

Working...