Solved

Web Service in c#, VS 2008 - System.Net.WebException: The underlying connection was closed

Posted on 2009-05-11
6
1,020 Views
Last Modified: 2012-08-13
I have suddenly started getting this error in our project. I am currently the only one who gets it, but I am unsure when it started happening, which is making it very difficult to track down whatever has been changed.

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: The system detected an invalid pointer address in attempting to use a pointer argument in a call. --->
System.Net.Sockets.SocketException: The system detected an invalid pointer address in attempting to use a pointer argument in a call
at System.Net.Sockets.Socket.MultipleSend(BufferOffsetSize[] buffers, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.MA first chance exception of type 'System.Net.WebException' occurred in System.Web.Services.dll

I am connecting to a Web Service, using c#. The Web Service is written in Java. I am succussfully loading data from it, but when I try to send data back, I get this error. I have tried all the suggestions I have found in this site, so I am now also doing:

protected override System.Net.WebRequest GetWebRequest(Uri uri)
        {
            System.Net.HttpWebRequest rval = base.GetWebRequest(uri) as System.Net.HttpWebRequest;

            if (rval != null)
            {
                rval.KeepAlive = false;
                rval.ProtocolVersion = HttpVersion.Version10;
            }

            return rval;
        }

but with no success.

Can anyone help (I have also disabled the firewall on my machine, to see if that helped - it didn't).

Many thanks.
0
Comment
Question by:DaveSkinner
  • 4
  • 2
6 Comments
 
LVL 7

Expert Comment

by:zwei
ID: 24354943
Don't know if this helps but MSDN says:

The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if an application passes an invalid pointer value, or if the length of the buffer is too small. For instance, if the length of an argument, which is a sockaddr structure, is smaller than the sizeof(sockaddr).

So it sounds like the buffer needs to be larger.
0
 

Author Comment

by:DaveSkinner
ID: 24355168
I am just using the standard Web Service feature of VS 2008, so I don't currently have much control at the level you are speaking about.

Although if that is what it takes...
0
 
LVL 7

Expert Comment

by:zwei
ID: 24355338
I think I found the source of your problem:

http://ph.answers.yahoo.com/question/index?qid=1006050816011

It describes the error when translating a virtual address to a physical one. As for the solution, I'm not sure. It seems to only happen to certain machines. Try updating/installing the same windows/software that the other people are using.

Sorry, maybe someone else can help.
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 

Author Comment

by:DaveSkinner
ID: 24356060
I hope so - dont think I follow that particular explanation! Thanks for your suggestions though, I am speaking to a couple of people here who may know what all that means.
0
 

Author Comment

by:DaveSkinner
ID: 24372244
Does anyone else have any suggestions?
0
 

Accepted Solution

by:
DaveSkinner earned 0 total points
ID: 24393213
This has resolved itself. I have genuinly changed nothing - it started working. I am starting to suspect a hardware issue on my machine. This can be closed.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question