473,545 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unexpected behavior - getting exception - Underlying connection cl

As per our requirements we have a web service which internally connects
(Simple HTTP Post Request) to a remote server to initiate some work. We are
calling the web service method asynchronously from a .NET Web Application
hosted on IIS. In our setup the web request form a client can be running for
long duration (may be more than 4 hours).

We are getting exceptions during the HTTP send/receive inside the web
service method. The exception are coming only during high load (for instance
when the pending web request count exceeds 45). For each web request the web
service internally do 10 iterations of Http send/receive (each iteration uses
a new Http connection). There is no fixed pattern in the type of exception
raised.

Following exceptions are coming:

1. The underlying connection was closed: An unexpected error occurred on a
receive
Status of Web Exception: ReceiveFailure
2. The underlying connection was closed: An unexpected error occurred on a
send
Status of Web Exception: SendFailure
3. The underlying connection was closed: Unable to connect to the remote
server
Status of Web Exception: ConnectFailure
4. The underlying connection was closed: The request was canceled
Status of Web Exception: RequestCanceled

I am using .NET Framework 1.1
Web Service and web application both are written in .NET and hosted on
Win2003. I had tested replacing web application with windows application but
got no improvement.
I have also observed that number RequestCancled exception has decreased once
we moved our web service form Win2000 Server to Win2003 Server.

I have tried the .NET bug fix by setting *keepalive* to false but still
getting exceptions.

I had modified the .NET config timeout settings to higher values.

<CODE>

HttpWebRequest webRequest = (HttpWebRequest )WebRequest.Cre ate("URL");
webRequest.Keep Alive = false;
webRequest.Prot ocolVersion=Htt pVersion.Versio n10;
webRequest.Time out = timeOut;
webRequest.Prox y = GlobalProxySele ction.GetEmptyW ebProxy();
webRequest.Meth od = "POST";
webRequest.Cont entType="applic ation/x-www-form-urlencoded";
StreamWriter myWriter = new StreamWriter(we bRequest.GetReq uestStream());
myWriter.Write( "some post Data");
myWriter.Close( );
WebResponse httpWebRes = httpWebRequest. GetResponse();
// Do some work with httpWebRes
httpWebRes.Clos e();

</CODE>

Thanks in advance.

--
Cheers,
Rahul Anand
Mar 28 '06 #1
3 4061
q
"some post Data" isn't a valid SOAP message. Web services communicate
with SOAP messages. You send it proper XML and you will (possibly) get
proper XML back.

Here are samples of what you have to send and what may be returned:
http://terraserver-usa.com/TerraServ...p=GetPlaceList

Mar 28 '06 #2
"q" wrote:
"some post Data" isn't a valid SOAP message. Web services communicate
with SOAP messages. You send it proper XML and you will (possibly) get
proper XML back.

Here are samples of what you have to send and what may be returned:
http://terraserver-usa.com/TerraServ...p=GetPlaceList


The Web Service is working fine and we are getting correct output. The
exceptions are coming during the communication with some other remote server
in our web method.
I think the problem is not directly related to web service. I suspect some
problem in network comminucation may be during heavy load the network
resources are not available or something.

--
Cheers,
Rahul Anand
Mar 28 '06 #3
I think you mean to say "service" then... this is not a web service if
it's not dependent on XML messages (by definition, a web service uses
SOAP XML messages and interop with other web service platforms). I
think you want to be asking about how to deal with exceptions from
HttpWebRequest (which has nothing to do with web services).

Mar 28 '06 #4

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

Similar topics

0
4234
by: Robert Mazur | last post by:
MySQL 5.0 alpha (binary install) on Solaris 9 -or- RedHat 8.0 mysql-connector-java-3.0.8-stable ----------------------- Is there something different going on with JDBC and the alpha version of MySQL 5.0? When trying to connect I am getting: ** BEGIN NESTED EXCEPTION **
5
24735
by: Vijayakrishna Pondala | last post by:
Hi, We are using the following error randomly, when accessing a webservice method/servlet hosted on JBoss application server: The underlying connection was closed: An unexpected error occurred on a receive. We are using .NET v1.1.
6
5476
by: Yoel | last post by:
Hi, I'm trying consuming web services over SSL by an ASP .Net client without success. System Architecture: My Server side contains the following layers, starting from the client side: (Client side) WSD firewall
3
1550
by: Rahul Anand | last post by:
As per our requirements we have a web service which internally connects (Simple HTTP Post Request) to a remote server to initiate some work. We are calling the web service method asynchronously from a .NET Web Application hosted on IIS. In our setup the web request form a client can be running for long duration (may be more than 4 hours). ...
0
1556
by: Mahesh Devjibhai Dhola | last post by:
Hi, I am getting the following exception when using webservice.. "The underlying connection was closed: An unexpected error occurred on a receive" I am not getting any innerexception so no clue for the reason. While i was seaching on web, i found the solutions but its not working for me. I have already override the method on client proxy ...
2
4355
by: Andrew Hunot | last post by:
I have VB code in VS2003 which creates a HttpWebRequest and performs a POST operation to a remote URL (an https site), which runs fine and receives a valid response. However exactly the same code in VS2005 (to the same site with the same data) causes an exception 'The underlying connection was closed: An unexpected error occurred on a...
2
4532
by: bevis | last post by:
I'm new to sql server and mysql but this seems like it should be a pretty straight forward jdbc connection. But I have spent almost 2 days just trying to get a jdbc connection. Please help if you can. I'm using Eclipse 3.2.2 and I have installed mysql-connector-java-5.0.6-bin.jar. I am trying to connect to SQL Enterprise Manager version 8.0...
0
2054
by: imonline | last post by:
Hi, I have created a asp.net page which posts XML on the web service using .net 2.0. The page and the webservice was working fine but once I converted them to .net 3.5 I have been getting following exception. And I am having this problem on the local machine that is both of them on same machine. Exception: System.Net.WebException was...
0
1626
by: =?Utf-8?B?T2xpdmllciBHSUw=?= | last post by:
Hello, I try to post an HTTP message containing an XML document, and I get the following exception : System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---System.IO.IOException: Unable to write data to the transport connection: Uma solicitação de envio ou recepção de dados não foi...
0
7478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7437
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3466
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.