473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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:

ServicePointManager.ServerCertificateValidationCal lback =
ValidateServerCertificate;

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

protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest)base.GetWebRequest(uri) ;
webRequest.KeepAlive = false;
System.Windows.Forms.MessageBox.Show(uri.ToString( ));
return webRequest;
}

Any other suggestions? Please help.

Taha

Jun 27 '08 #1
0 1605

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Tomas Kepic | last post by:
Hi, i'm trying to create my first ASP.NET project ( HelloASPWorld project) but an error occured when I put OK button in NewProject. ERROR: "The Web server reported the following error when...
0
by: paulngpc | last post by:
> Hi folks > > This is a challenging and interesting topic. Need HELP on > this, would be good if some tips/techniques can be given > for the topic. > > Using VB.NET client to connect to...
6
by: kbs | last post by:
Hi, I'm looking for some good examples that illustrate how to code a web service that exposes a custom collection so that the properties of the collection are accessible on the client without...
0
by: David Mediavilla | last post by:
I am writing a client for an HTTPS web service using WSE 1.0 but I always get an error like "The underlying connection was closed: An unexpected error occurred on a send." Sometimes the error...
3
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object...
0
by: ronscottlangham | last post by:
I have my WCF Web Service behind IIS and HTTPS. If I try to access from my remote client I get the following error... The requested service, 'https://db-appsvr02/appService/appService.svc'...
18
by: SteveHasel | last post by:
I'm trying to consume a web service that was generated by Oracle JDeveloper for a ASP.NET site in Visual Studio 2005. I used the Add Web Reference interface and everything seemed to work fine, but...
3
by: Lance Wynn | last post by:
Hello, I am receiving this error when trying to instantiate a webservice component. I have 2 development machines, both are XP sp2 with VS 2008 installed. On one machine, the code works fine. On...
0
by: =?Utf-8?B?a2F1c2hhcw==?= | last post by:
Apologies for cross posting to couple of WCF related forums, but I am frantically trying to find a solution to this WCF Mex endpoint problem described below: I am getting this weird error when...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.