Showing posts with label systemnetwebexception. Show all posts
Showing posts with label systemnetwebexception. Show all posts

Saturday, March 24, 2012

System.Net.WebException

Hi,
I am calling an external web service that returns some data which is being
displayed on my ASP.NET page. This page refreshes every 60 seconds and pulls
the updated data from the web service.
The page works great for a few minutes and then all of a sudden throws the
following error:
System.Net.WebException: Unable to connect to the remote server -->
System.Net.Sockets.SocketException: A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState
state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
-- End of inner exception stack trace --
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at fhlb.cmkt.CFM.proxy.NetWireService.NetWireService.getNetWires(getNetWires
getNetWires1) in E:\Projects\CapitalMarkets\CFM\fhlb.cmkt.proxy\Web
References\NetWireService\Reference.cs:line 115
at fhlb.cmkt.CFM.CashFlowMonitor.getNetWiresSecured()
at fhlb.cmkt.CFM.CashFlowMonitor.Page_Load(Object sender, EventArgs e)
Using ASP.NET 2.0 on IIS 6.0 (Windows Server 2003).
Any help will be greatly appreciated.
Thanks!this is normal. it just a timeout on a page request. you need to decide how
to handle it. maybe save the last results and resuse.
-- bruce (sqlwork.com)
"Vijay" wrote:

> Hi,
> I am calling an external web service that returns some data which is being
> displayed on my ASP.NET page. This page refreshes every 60 seconds and pul
ls
> the updated data from the web service.
> The page works great for a few minutes and then all of a sudden throws the
> following error:
> System.Net.WebException: Unable to connect to the remote server -->
> System.Net.Sockets.SocketException: A connection attempt failed because th
e
> connected party did not properly respond after a period of time, or
> established connection failed because connected host has failed to respond
> at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
> SocketAddress socketAddress)
> at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
> at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,
> Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketSta
te
> state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
> -- End of inner exception stack trace --
> at System.Net.HttpWebRequest.GetRequestStream()
> at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
> methodName, Object[] parameters)
> at fhlb.cmkt.CFM.proxy.NetWireService.NetWireService.getNetWires(getNetWir
es
> getNetWires1) in E:\Projects\CapitalMarkets\CFM\fhlb.cmkt.proxy\Web
> References\NetWireService\Reference.cs:line 115
> at fhlb.cmkt.CFM.CashFlowMonitor.getNetWiresSecured()
> at fhlb.cmkt.CFM.CashFlowMonitor.Page_Load(Object sender, EventArgs e)
> Using ASP.NET 2.0 on IIS 6.0 (Windows Server 2003).
> Any help will be greatly appreciated.
> Thanks!
Thanks for the quick reply Bruce.
Is it a timeout on the webpage that is calling the web service or is it a
timeout that is occuring on the web service? What does it mean when you say
"save the last results and reuse" ?
Thanks!
Vijay
"bruce barker" wrote:
> this is normal. it just a timeout on a page request. you need to decide ho
w
> to handle it. maybe save the last results and resuse.
> -- bruce (sqlwork.com)
>
> "Vijay" wrote:
>

System.Net.WebException and server committed a protocol violation

Hi there,

Does anyone knows what causes the System.Net.WebException and server committed a protocol violation and how do I debug it? Sometimes when I send the url request string to the web brower by using theHttpWebRequest andHttpWebResponseand it doesn't have any System.Net.WebException or server committed a protocol violation, but after a couple request sending, I get that error at theHttpWebResponse ,at first I thought because there are too many request sending at once, that's why it causes the System.Net.WebException and the server committed a protocol violation, but after a few minutes waiting and I re-send it again and still have the same error. Does anyone have the same problem that I have? This is the HTTPHandler Class and sending the request string by the url

I google some search and found some article saying that you can create a function to disable thewebRequest.KeepAlive = false;to solve that problem, but I got an error at 'HandlerLibrary.WebRequest(string)': no suitable method found to override, Can someone shows me the right way to fix this issue, thanks

protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest webRequest = (HttpWebRequest)base.GetWebRequest(uri);

webRequest.KeepAlive = false;
return webRequest;
}

System.Net.WebException:

Hi,
I am trying to make a simple file updload WinForm app.
Here's the code:
WebClient webClient = new WebClient();
webClient.UploadFile(new Uri("http://localhost/WebSite/Upload.aspx"),
"c:\\bin.zip");

My IIS 5.1 Web server uses default configuration.
If the file is less than 5Mo everything works fine. If the file is too big I
get this exception:
System.Net.WebException: The underlying connection was closed: An unexpected
error occurred on a receive. --> System.IO.IOException: Unable to read data
from the transport connection: An existing connection was forcibly closed by
the remote host. --> System.Net.Sockets.SocketException: An existing
connection was forcibly closed by the remote host

I will never have to upload more than 30Mo.
Do you now how I can correct this issue ?In the web.config file, the httpRunTime element has a maxRequestLength which
restricts the length in bytes of any HTTP request. The default is 4MB.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"zolof" <zolof@.discussions.microsoft.com> wrote in message
news:C12D293F-C3B4-401C-99A6-7A10DB48B8BE@.microsoft.com...
> Hi,
> I am trying to make a simple file updload WinForm app.
> Here's the code:
> WebClient webClient = new WebClient();
> webClient.UploadFile(new Uri("http://localhost/WebSite/Upload.aspx"),
> "c:\\bin.zip");
> My IIS 5.1 Web server uses default configuration.
> If the file is less than 5Mo everything works fine. If the file is too big
> I
> get this exception:
> System.Net.WebException: The underlying connection was closed: An
> unexpected
> error occurred on a receive. --> System.IO.IOException: Unable to read
> data
> from the transport connection: An existing connection was forcibly closed
> by
> the remote host. --> System.Net.Sockets.SocketException: An existing
> connection was forcibly closed by the remote host
> I will never have to upload more than 30Mo.
> Do you now how I can correct this issue ?
That's great. Thanks a lot for your help.

System.Net.WebException:

Hi,
I am trying to make a simple file updload WinForm app.
Here's the code:
WebClient webClient = new WebClient();
webClient.UploadFile(new Uri("http://localhost/WebSite/Upload.aspx"),
"c:\\bin.zip");
My IIS 5.1 Web server uses default configuration.
If the file is less than 5Mo everything works fine. If the file is too big I
get this exception:
System.Net.WebException: The underlying connection was closed: An unexpected
error occurred on a receive. --> System.IO.IOException: Unable to read data
from the transport connection: An existing connection was forcibly closed by
the remote host. --> System.Net.Sockets.SocketException: An existing
connection was forcibly closed by the remote host
I will never have to upload more than 30Mo.
Do you now how I can correct this issue ?In the web.config file, the httpRunTime element has a maxRequestLength which
restricts the length in bytes of any HTTP request. The default is 4MB.
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Hard work is a medication for which
there is no placebo.
"zolof" <zolof@.discussions.microsoft.com> wrote in message
news:C12D293F-C3B4-401C-99A6-7A10DB48B8BE@.microsoft.com...
> Hi,
> I am trying to make a simple file updload WinForm app.
> Here's the code:
> WebClient webClient = new WebClient();
> webClient.UploadFile(new Uri("http://localhost/WebSite/Upload.aspx"),
> "c:\\bin.zip");
> My IIS 5.1 Web server uses default configuration.
> If the file is less than 5Mo everything works fine. If the file is too big
> I
> get this exception:
> System.Net.WebException: The underlying connection was closed: An
> unexpected
> error occurred on a receive. --> System.IO.IOException: Unable to read
> data
> from the transport connection: An existing connection was forcibly closed
> by
> the remote host. --> System.Net.Sockets.SocketException: An existing
> connection was forcibly closed by the remote host
> I will never have to upload more than 30Mo.
> Do you now how I can correct this issue ?
>
That's great. Thanks a lot for your help.

System.Net.WebException: The remote server returned an error: (500) Internal Server Error.

Hi
I am trying to consume a web service from asp.net web page through
HTTP POST method and I am getting the following error message

"System.Net.WebException: The remote server returned an error: (500)
Internal Server Error."

I have been searchign the web and followed all the options which worked

for others

1. Changed the web.config of the web service to accomodate HttpPost
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices
2. Used the HttpRequest.Credentials =
CredentialCache.DefaultCredentials;

I am not sure what is wrong there it fails while the request is sent to

the web service. The web service works fine with other web clients

Let me know your ideas

thanks
MohanOther web clients? What is different? Run the debugger on the server,
set a breakpoint and POST from your client, and step through the code
sirfunusa wrote:
> Other web clients? What is different? Run the debugger on the server,
> set a breakpoint and POST from your client, and step through the code

Other clients I mean when I reference the web service and access the
web method it works fine...But when I use an ASP.NET page with the
HTTPReuest Object as shown below it throws the error

"System.Net.WebException: The remote server returned an error: (500)
Internal Server Error."

Code :

HttpWebRequest wr =
(HttpWebRequest)WebRequest.Create("http://localhost//SubtractNumbers//Service1.asmx//Subtract");

wr.Method = "POST";
wr.ContentType = "application/x-www-form-urlencoded";
//wr.ContentLength = bytes.Length;

StreamWriter writer = new
StreamWriter(wr.GetRequestStream(),System.Text.Enc oding.UTF8);
//// Write the xml text into the stream
writer.WriteLine("Hi");
writer.Close();

WebResponse wrs = wr.GetResponse();
Stream strm = wrs.GetResponseStream();
StreamReader sr = new StreamReader(strm);
String line;
while( (line = sr.ReadLine()) != null)
Response.Write(line);
strm.Close();
sirfunusa wrote:
> Other web clients? What is different? Run the debugger on the server,
> set a breakpoint and POST from your client, and step through the code

Other clients I mean when I reference the web service and access the
web method it works fine...But when I use an ASP.NET page with the
HTTPReuest Object as shown below it throws the error

"System.Net.WebException: The remote server returned an error: (500)
Internal Server Error."

Code :

HttpWebRequest wr =
(HttpWebRequest)WebRequest.Create("http://localhost//SubtractNumbers//Service1.asmx//Subtract");

wr.Method = "POST";
wr.ContentType = "application/x-www-form-urlencoded";
//wr.ContentLength = bytes.Length;

StreamWriter writer = new
StreamWriter(wr.GetRequestStream(),System.Text.Enc oding.UTF8);
//// Write the xml text into the stream
writer.WriteLine("Hi");
writer.Close();

WebResponse wrs = wr.GetResponse();
Stream strm = wrs.GetResponseStream();
StreamReader sr = new StreamReader(strm);
String line;
while( (line = sr.ReadLine()) != null)
Response.Write(line);
strm.Close();
Are you sending the proper XML message (SOAP)? If your message isn't
formatted properly, you will definately get a server 500 error back.
It looks liek you are actually just sending text ("Hi"). That's not a
proper SOAP message. Here is a sample of a SOAP message:
http://www.w3.org/2004/06/03-google-soap-wsdl.html .

I personally much of web services manually because it's just easier to
interop with COM that way.

Here's part of what I do... (also be sure to set your SOAPAction in the
http header!) messageData hold my XML message I'm sending.

ASCIIEncoding encoding = new ASCIIEncoding( );
byte[] buffer = encoding.GetBytes(messageData);

HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create(this.EndPoint);
myRequest.Method = "POST";
myRequest.ContentType = "text/xml";
myRequest.ContentLength = buffer.Length;
myRequest.Headers.Add(String.Format("SOAPAction: \"{0}\"",
operationName));
myRequest.Timeout = 10000;

using (Stream newStream = myRequest.GetRequestStream( )) {
newStream.Write(buffer, 0, buffer.Length);
newStream.Close( );
}

HttpWebResponse myHttpWebResponse =
(HttpWebResponse)myRequest.GetResponse( );

string rawResponse =
GetWebResponseString(myHttpWebResponse);

myHttpWebResponse.Close( );

Here is the GetWebResponseString method...

private static string GetWebResponseString(WebResponse
myHttpWebResponse) {
StringBuilder rawResponse = new StringBuilder( );
using (Stream streamResponse =
myHttpWebResponse.GetResponseStream( )) {
using (StreamReader streamRead = new
StreamReader(streamResponse)) {
Char[] readBuffer = new Char[256];
int count = streamRead.Read(readBuffer, 0, 256);

while (count > 0) {
String resultData = new String(readBuffer, 0,
count);
rawResponse.Append(resultData);
count = streamRead.Read(readBuffer, 0, 256);
}
}
}
return rawResponse.ToString( );
}

Look closely at what is returned. You may actually be getting the
reason for the fault in the message.

Also, if all is successful, you will get an XML message back. Are you
prepared to parse it?

You may want to actually use the .NET web service mechanism if you
don't want to do everything manually. Since you aren't using the .NET
web service mechanism the web.config configuration doesn't apply.

If you are intending to use .NET for web services, then all you have to
do is add the WSDL file as a web reference and use it as though it were
local. There's not really much work to it. If that is the case then
everything I said above is void, since this is the manual way to do it.

System.Net.WebException: The request failed with the error message:Object moved to he

Greetings,
This question is related to Microsoft Reporting Services Web service. I
tried asking it in RS groups but no one seems to be knowledgeable enough to
answer, so I wanted to try my chances here. Thanks...
I am trying to get the code below to work with no success, I googled the
issue but docs popped up provided little help. Basically I am trying to
create a directory in RS that uses Forms authentication. Everything works on
the Forms authentication side, but it looks like the cookie created using
the web service somehow does not satisfy RS and it tries to redirect to the
logon page.
Could you point me with a document or just provide me with a working sample?
I already tried Teo Lachev's example with no luck.
Thanks,
Skep...
PS: Both web application and the RS are on the same server.
ReportingService rs = new ReportingService();
ReportServerProxy server = new ReportServerProxy();
// Get the server URL from the Report Manager configuration file
server.Url = AuthenticationUtilities.GetWebServiceUrl();
bool passwordVerified = false;
try
{
server.LogonUser("user","password", null);
passwordVerified = true;
}
catch(System.Web.Services.Protocols.SoapException)
{
Message.Text = "Login Error, please try again";
return;
}
// Create a custom property for the folder.
Property newProp = new Property();
newProp.Name = "Department";
newProp.Value = "Finance";
Property[] props = new Property[1];
props[0] = newProp;
string folderName = "Budget";
try
{
rs.CreateFolder(folderName, "/", props );
Label2.Text="Folder created: "+ folderName;
}
catch(Exception ex)
{
Message.Text=ex.ToString();
}Hi Skeptical:
How is the LogonUser call itself authenticated? Do you have anon
access for that call?
I suspect you need to create a CookieContainer object and assign the
instance to the Cookie property of the SSRS proxy class. The
CookieContainer will accept the Set-Cookie header from SSRS and pass
the cookie along on subsequest requests.
Scott
http://www.OdeToCode.com/blogs/scott/
On Thu, 19 May 2005 15:58:56 -0500, "Skeptical" <skep@.nowhere.com>
wrote:

>Greetings,
>This question is related to Microsoft Reporting Services Web service. I
>tried asking it in RS groups but no one seems to be knowledgeable enough to
>answer, so I wanted to try my chances here. Thanks...
>
>I am trying to get the code below to work with no success, I googled the
>issue but docs popped up provided little help. Basically I am trying to
>create a directory in RS that uses Forms authentication. Everything works o
n
>the Forms authentication side, but it looks like the cookie created using
>the web service somehow does not satisfy RS and it tries to redirect to the
>logon page.
>Could you point me with a document or just provide me with a working sample
?
>I already tried Teo Lachev's example with no luck.
>Thanks,
>Skep...
>PS: Both web application and the RS are on the same server.
>
>ReportingService rs = new ReportingService();
>ReportServerProxy server = new ReportServerProxy();
>// Get the server URL from the Report Manager configuration file
>server.Url = AuthenticationUtilities.GetWebServiceUrl();
>bool passwordVerified = false;
>try
>{
>server.LogonUser("user","password", null);
>passwordVerified = true;
>}
>catch(System.Web.Services.Protocols.SoapException)
>{
>Message.Text = "Login Error, please try again";
>return;
>}
>// Create a custom property for the folder.
>Property newProp = new Property();
>newProp.Name = "Department";
>newProp.Value = "Finance";
>Property[] props = new Property[1];
>props[0] = newProp;
>string folderName = "Budget";
>try
>{
>rs.CreateFolder(folderName, "/", props );
>Label2.Text="Folder created: "+ folderName;
>}
>catch(Exception ex)
>{
>Message.Text=ex.ToString();
>}
>
>

System.Net.WebException: The request failed with the error message:Object moved to here

Greetings,

This question is related to Microsoft Reporting Services Web service. I
tried asking it in RS groups but no one seems to be knowledgeable enough to
answer, so I wanted to try my chances here. Thanks...

I am trying to get the code below to work with no success, I googled the
issue but docs popped up provided little help. Basically I am trying to
create a directory in RS that uses Forms authentication. Everything works on
the Forms authentication side, but it looks like the cookie created using
the web service somehow does not satisfy RS and it tries to redirect to the
logon page.

Could you point me with a document or just provide me with a working sample?

I already tried Teo Lachev's example with no luck.

Thanks,

Skep...

PS: Both web application and the RS are on the same server.

ReportingService rs = new ReportingService();
ReportServerProxy server = new ReportServerProxy();

// Get the server URL from the Report Manager configuration file
server.Url = AuthenticationUtilities.GetWebServiceUrl();
bool passwordVerified = false;
try
{
server.LogonUser("user","password", null);
passwordVerified = true;
}
catch(System.Web.Services.Protocols.SoapException)
{
Message.Text = "Login Error, please try again";
return;
}
// Create a custom property for the folder.
Property newProp = new Property();
newProp.Name = "Department";
newProp.Value = "Finance";
Property[] props = new Property[1];
props[0] = newProp;
string folderName = "Budget";
try
{
rs.CreateFolder(folderName, "/", props );
Label2.Text="Folder created: "+ folderName;
}
catch(Exception ex)
{
Message.Text=ex.ToString();
}Hi Skeptical:

How is the LogonUser call itself authenticated? Do you have anon
access for that call?

I suspect you need to create a CookieContainer object and assign the
instance to the Cookie property of the SSRS proxy class. The
CookieContainer will accept the Set-Cookie header from SSRS and pass
the cookie along on subsequest requests.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 19 May 2005 15:58:56 -0500, "Skeptical" <skep@.nowhere.com>
wrote:

>Greetings,
>This question is related to Microsoft Reporting Services Web service. I
>tried asking it in RS groups but no one seems to be knowledgeable enough to
>answer, so I wanted to try my chances here. Thanks...
>
>I am trying to get the code below to work with no success, I googled the
>issue but docs popped up provided little help. Basically I am trying to
>create a directory in RS that uses Forms authentication. Everything works on
>the Forms authentication side, but it looks like the cookie created using
>the web service somehow does not satisfy RS and it tries to redirect to the
>logon page.
>Could you point me with a document or just provide me with a working sample?
>I already tried Teo Lachev's example with no luck.
>Thanks,
>Skep...
>PS: Both web application and the RS are on the same server.
>
>ReportingService rs = new ReportingService();
>ReportServerProxy server = new ReportServerProxy();
>// Get the server URL from the Report Manager configuration file
>server.Url = AuthenticationUtilities.GetWebServiceUrl();
>bool passwordVerified = false;
>try
>{
>server.LogonUser("user","password", null);
>passwordVerified = true;
>}
>catch(System.Web.Services.Protocols.SoapException)
>{
>Message.Text = "Login Error, please try again";
>return;
>}
>// Create a custom property for the folder.
>Property newProp = new Property();
>newProp.Name = "Department";
>newProp.Value = "Finance";
>Property[] props = new Property[1];
>props[0] = newProp;
>string folderName = "Budget";
>try
>{
>rs.CreateFolder(folderName, "/", props );
>Label2.Text="Folder created: "+ folderName;
>}
>catch(Exception ex)
>{
>Message.Text=ex.ToString();
>}

System.Net.WebException: The request was aborted: The request was canceled.

Hello everyone,

Can anyone help me solve this problem? I'm trying to upload files from a client side to the server side, it uploads fine for any small files under <20mb and fails any files >20mb. I have set in the server side web config for the Runtime executionTimeout="650" and the maximum size length is 100MB, it it still fails under 2 minutes from the time it starts upload to the time the request was aborted, the request was cancel. Can anyone tell me is this a timeout from the Client side or a Service side and how do I fix this timeout issue to get the upload files to the host without being timeout?

anyone?


Is the stack trace available?

I suspecting the web.config file doesn't even take effect.


minutem for replying, here is the trace log that fail to upload th large file, because the System.Net.WebException: The request was aborted: The request was canceled.

"12-04-2007 14:52:48: Uploading c:\test\AC.zip to server"
"12-04-2007 14:52:48: http://www.rsvr.com/uploadservice2.0/uploadservice.asmx/Login?uname=randd&pword=test"
"12-04-2007 14:52:53: Valid User."
"12-04-2007 14:52:53: Starting Upload:http://www.rsvr.com/uploadservice2.0/uploadservice.asmx/UploadFile?c:\test\AC.zip "
"12-04-2007 14:54:33: Upload Failed: The request was aborted: The request was canceled."
"12-04-2007 14:54:33: Upload Failed: System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
at System.Net.WebClient.UploadFile(String address, String method, String fileName)

System.Net.WebException: The underlying connection was closed:

Hi Tim,

From your description, you've a ASP.NET webservcie and created a Winform
client app to consume it. However, when calling the webservice, you found
it worked well the first time but occured unexpected error the second time
after a few minutes, yes?

From the code you provided(calling the webservice), it seems all right and
I don't think the problem is likely in the client application. I'm not sure
about the webservice's detailed code logic in its webmethods but from the
method's signature:

WebSvcW.OMTestAddOrderXML(comboBox3.Text,int.Parse (textBox2.Text),comboBox4.
Text);

it takes simply type params, so I think we can test the webservice through
IE, open the certain url (http://...... .asmx) in the IE and call the
webservice thourgh it. It is better if you can use VS.NET to debug the
webservice on the serverside to see whether the problem also occured when
calling it from IE. If still remains, we can confirm that the problem is
not caused by the winform client , do you think so?

In addition, as for creating client application to consume webservice,
below is the related web link in MSDN:
#Creating Clients for XML Web Services
http://msdn.microsoft.com/library/e...atingclientsfor
webservices.asp?frame=true

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspxHi Tim,

Have you had a chance to view the suggestions in my last reply or have you
got any progresses on this issue? If there is anything else I can help,
please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks for your reply. However, when I try to go directly to the ..asmx url via IA, when I click on the name of the web service in order to test, I receive this message - Tes
The test form is only available for requests from the local machine. Therefore, I am unclear on how to proceed. The server is in another state so I can't logon directly to it in order to test from my location. How shall I proceed

Thank you
Tim Reynold
Verizon
Hi Tim,

From your reply, you haven't the certain permission to logon the server
which host the webservice, yes? Then, I think we can do the following tests
on the webservice:

1. Creating a client proxy through the following guide(using wsdl.exe
rather than via VS.NET) and consume the webservice by the geneated proxy to
see whether the webservice still fail.
#Creating an XML Web Service Proxy
http://msdn.microsoft.com/library/e...atingWebService
Proxy.asp?frame=true

2. I'm not sure whether you have ever tried calling a webservice via
javascript(DHTML) in a webpage, if not, you may have a look at the
following reference:
#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/e...001.asp?frame=t
rue

If you're able to perform a test via the DHTML way, we can further confirm
whether the problem is with the serverside or not.

In addtion, you can create a simple webservice( similiar with the one
you're consuming, maybe just take 2 string parameters) on your local
machine or a remote machine which you have full control on it. And then
call it on the local machine to see whether the same problem occurs. If
not, that also probably proof that the problem is likely due to the
webservice's serverside processing.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,

Any progress on this issue? If you have any problems on this or if there're
anything else I can help, please feel free to let me know. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

System.Net.WebException: The underlying connection was closed:

Hi Tim,

From your description, you've a ASP.NET webservcie and created a Winform
client app to consume it. However, when calling the webservice, you found
it worked well the first time but occured unexpected error the second time
after a few minutes, yes?

From the code you provided(calling the webservice), it seems all right and
I don't think the problem is likely in the client application. I'm not sure
about the webservice's detailed code logic in its webmethods but from the
method's signature:

WebSvcW.OMTestAddOrderXML(comboBox3.Text,int.Parse (textBox2.Text),comboBox4.
Text);

it takes simply type params, so I think we can test the webservice through
IE, open the certain url (http://...... .asmx) in the IE and call the
webservice thourgh it. It is better if you can use VS.NET to debug the
webservice on the serverside to see whether the problem also occured when
calling it from IE. If still remains, we can confirm that the problem is
not caused by the winform client , do you think so?

In addition, as for creating client application to consume webservice,
below is the related web link in MSDN:
#Creating Clients for XML Web Services
http://msdn.microsoft.com/library/e...atingclientsfor
webservices.asp?frame=true

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspxHi Tim,

Have you had a chance to view the suggestions in my last reply or have you
got any progresses on this issue? If there is anything else I can help,
please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks for your reply. However, when I try to go directly to the ..asmx url via IA, when I click on the name of the web service in order to test, I receive this message - Tes
The test form is only available for requests from the local machine. Therefore, I am unclear on how to proceed. The server is in another state so I can't logon directly to it in order to test from my location. How shall I proceed

Thank you
Tim Reynold
Verizon
Hi Tim,

From your reply, you haven't the certain permission to logon the server
which host the webservice, yes? Then, I think we can do the following tests
on the webservice:

1. Creating a client proxy through the following guide(using wsdl.exe
rather than via VS.NET) and consume the webservice by the geneated proxy to
see whether the webservice still fail.
#Creating an XML Web Service Proxy
http://msdn.microsoft.com/library/e...atingWebService
Proxy.asp?frame=true

2. I'm not sure whether you have ever tried calling a webservice via
javascript(DHTML) in a webpage, if not, you may have a look at the
following reference:
#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/e...001.asp?frame=t
rue

If you're able to perform a test via the DHTML way, we can further confirm
whether the problem is with the serverside or not.

In addtion, you can create a simple webservice( similiar with the one
you're consuming, maybe just take 2 string parameters) on your local
machine or a remote machine which you have full control on it. And then
call it on the local machine to see whether the same problem occurs. If
not, that also probably proof that the problem is likely due to the
webservice's serverside processing.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,

Any progress on this issue? If you have any problems on this or if there're
anything else I can help, please feel free to let me know. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

System.Net.WebException: The underlying connection was closed:

Hi Tim,

From your description, you've a ASP.NET webservcie and created a Winform
client app to consume it. However, when calling the webservice, you found
it worked well the first time but occured unexpected error the second time
after a few minutes, yes?

From the code you provided(calling the webservice), it seems all right and
I don't think the problem is likely in the client application. I'm not sure
about the webservice's detailed code logic in its webmethods but from the
method's signature:

WebSvcW.OMTestAddOrderXML(comboBox3.Text,int.Parse (textBox2.Text),comboBox4.
Text);

it takes simply type params, so I think we can test the webservice through
IE, open the certain url (http://...... .asmx) in the IE and call the
webservice thourgh it. It is better if you can use VS.NET to debug the
webservice on the serverside to see whether the problem also occured when
calling it from IE. If still remains, we can confirm that the problem is
not caused by the winform client , do you think so?

In addition, as for creating client application to consume webservice,
below is the related web link in MSDN:
#Creating Clients for XML Web Services
http://msdn.microsoft.com/library/e...atingclientsfor
webservices.asp?frame=true

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspxHi Tim,

Have you had a chance to view the suggestions in my last reply or have you
got any progresses on this issue? If there is anything else I can help,
please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks for your reply. However, when I try to go directly to the ..asmx url via IA, when I click on the name of the web service in order to test, I receive this message - Tes
The test form is only available for requests from the local machine. Therefore, I am unclear on how to proceed. The server is in another state so I can't logon directly to it in order to test from my location. How shall I proceed

Thank you
Tim Reynold
Verizon
Hi Tim,

From your reply, you haven't the certain permission to logon the server
which host the webservice, yes? Then, I think we can do the following tests
on the webservice:

1. Creating a client proxy through the following guide(using wsdl.exe
rather than via VS.NET) and consume the webservice by the geneated proxy to
see whether the webservice still fail.
#Creating an XML Web Service Proxy
http://msdn.microsoft.com/library/e...atingWebService
Proxy.asp?frame=true

2. I'm not sure whether you have ever tried calling a webservice via
javascript(DHTML) in a webpage, if not, you may have a look at the
following reference:
#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/e...001.asp?frame=t
rue

If you're able to perform a test via the DHTML way, we can further confirm
whether the problem is with the serverside or not.

In addtion, you can create a simple webservice( similiar with the one
you're consuming, maybe just take 2 string parameters) on your local
machine or a remote machine which you have full control on it. And then
call it on the local machine to see whether the same problem occurs. If
not, that also probably proof that the problem is likely due to the
webservice's serverside processing.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,

From your reply, you haven't the certain permission to logon the server
which host the webservice, yes? Then, I think we can do the following tests
on the webservice:

1. Creating a client proxy through the following guide(using wsdl.exe
rather than via VS.NET) and consume the webservice by the geneated proxy to
see whether the webservice still fail.
#Creating an XML Web Service Proxy
http://msdn.microsoft.com/library/e...atingWebService
Proxy.asp?frame=true

2. I'm not sure whether you have ever tried calling a webservice via
javascript(DHTML) in a webpage, if not, you may have a look at the
following reference:
#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/e...001.asp?frame=t
rue

If you're able to perform a test via the DHTML way, we can further confirm
whether the problem is with the serverside or not.

In addtion, you can create a simple webservice( similiar with the one
you're consuming, maybe just take 2 string parameters) on your local
machine or a remote machine which you have full control on it. And then
call it on the local machine to see whether the same problem occurs. If
not, that also probably proof that the problem is likely due to the
webservice's serverside processing.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,

Any progress on this issue? If you have any problems on this or if there're
anything else I can help, please feel free to let me know. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,

Any progress on this issue? If you have any problems on this or if there're
anything else I can help, please feel free to let me know. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

System.Net.WebException: The underlying connection was closed:

Team,
We have deployed a webservice (asmx.cs) to a server. We have created a windo
ws app (C# using visual studios.net 2003 Enterprise Arch) that refers to the
web service. In the windows app, we added the web reference - referring to
the ?wsdl file. The C# co
de is quite simple:
VOSEWebServicesDevW.WebServices WebSvcW = new VOSEWebServicesDevW.WebService
s();
returncode = WebSvcW.OMTestAddOrderXML(comboBox3.Text,int.Parse(textBox2.Tex
t),comboBox4.Text);
This works fine the first time- but when it sits a few minutes and we retry
, we receive...
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Net.WebException: The underlying connection was closed: An unexpected
error occurred on a send.
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest
request)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebReq
uest request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String method
Name, Object[] parameters)
at TestWebServiceW.VOSEWebServicesDevW.WebServices.OMTestAddOrderXML(String
strCompany, Int32 intOrderNo, String strOrderType)
at TestWebServiceW.Form1.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, I
nt32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr
wparam, IntPtr lparam)
The project for the web service has a web.config file. I see no settings in
there of interest. I am new to this.
I would appreciate the guidance on what to do in the windows app C# code to
correctly access the web service on the team's server without having to clos
e & restart the windows app.
Thanks,
Tim Reynolds
VerizonHi Tim,
From your description, you've a ASP.NET webservcie and created a Winform
client app to consume it. However, when calling the webservice, you found
it worked well the first time but occured unexpected error the second time
after a few minutes, yes?
From the code you provided(calling the webservice), it seems all right and
I don't think the problem is likely in the client application. I'm not sure
about the webservice's detailed code logic in its webmethods but from the
method's signature:
WebSvcW.OMTestAddOrderXML(comboBox3.Text,int.Parse(textBox2.Text),comboBox4.
Text);
it takes simply type params, so I think we can test the webservice through
IE, open the certain url (http://...... .asmx) in the IE and call the
webservice thourgh it. It is better if you can use VS.NET to debug the
webservice on the serverside to see whether the problem also occured when
calling it from IE. If still remains, we can confirm that the problem is
not caused by the winform client , do you think so?
In addition, as for creating client application to consume webservice,
below is the related web link in MSDN:
#Creating Clients for XML Web Services
http://msdn.microsoft.com/library/e...atingclientsfor
webservices.asp?frame=true
Hope also helps. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,
Have you had a chance to view the suggestions in my last reply or have you
got any progresses on this issue? If there is anything else I can help,
please feel free to post here. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks for your reply. However, when I try to go directly to the ..asmx url
via IA, when I click on the name of the web service in order to test, I rec
eive this message - Test
The test form is only available for requests from the local machine. There
fore, I am unclear on how to proceed. The server is in another state so I ca
n't logon directly to it in order to test from my location. How shall I pro
ceed?
Thank you,
Tim Reynolds
Verizon
Hi Tim,
Any progress on this issue? If you have any problems on this or if there're
anything else I can help, please feel free to let me know. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,
From your reply, you haven't the certain permission to logon the server
which host the webservice, yes? Then, I think we can do the following tests
on the webservice:
1. Creating a client proxy through the following guide(using wsdl.exe
rather than via VS.NET) and consume the webservice by the geneated proxy to
see whether the webservice still fail.
#Creating an XML Web Service Proxy
http://msdn.microsoft.com/library/e...atingWebService
Proxy.asp?frame=true
2. I'm not sure whether you have ever tried calling a webservice via
javascript(DHTML) in a webpage, if not, you may have a look at the
following reference:
#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/e...001.asp?frame=t
rue
If you're able to perform a test via the DHTML way, we can further confirm
whether the problem is with the serverside or not.
In addtion, you can create a simple webservice( similiar with the one
you're consuming, maybe just take 2 string parameters) on your local
machine or a remote machine which you have full control on it. And then
call it on the local machine to see whether the same problem occurs. If
not, that also probably proof that the problem is likely due to the
webservice's serverside processing.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

System.Net.WebException: The underlying connection was closed: An unexpected error occurre

I get this error intermittently while using a web service on my local machine.
----------------------------------------------------------
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: An established connection was aborted by the software in your host machine. -->

System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine at System.Net.Sockets.Socket.MultipleSend(BufferOffsetSize[] buffers, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers) --
End of inner exception stack trace --
at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers) at System.Net.PooledStream.MultipleWrite(BufferOffsetSize[] buffers) at System.Net.Connection.Write(ScatterGatherBuffers writeBuffer) at System.Net.ConnectStream.ResubmitWrite(ConnectStream oldStream, Boolean suppressWrite) --
End of inner exception stack trace --
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at QueuesUtilitiesWS.QueuesUtilitiesService.utilitiesGetHosts() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Temporary ASP.NET Files\website\d482aaa7\b121dbcb\bysspbbr.1.cs:line 50 at QManager.GetQInfo() in c:\MyData\Development\UPMC.2.0.net\Developers\dextdr\WebSite\QManager.aspx.cs:line 97
----------------------------------------------------------
I can't figure out what the problem is and most of the posts I've Googled don't seem to have a very good resolution either.
I'm using Whidbey beta 2
Thanks.
Doug
I have the same error. Please help me! Thanks!
"An established connection was aborted by the software in your host machine"
I have the same error. Who can help me? Thanks!
Hi there..
I have not found an answer to this problem yet.
Check this out though:

http://weblogs.asp.net/jan/archive/2004/01/28/63771.aspx
Let me know if you figure it out and I will do the same.
God Bless.
Doug
Any luck on solving this problem?
We have a Reporting Services server and client program we have been running for a year. Lately, it is has been randomly failing with the same message.
I tried the keepalive fix but that is causing an access denied error. I then tried the fix for the 401 message in the MSDN knowledge base w/o success

//Create an instance of the CredentialCache class.
System.Net.CredentialCache cache =new System.Net.CredentialCache();

// Add a NetworkCredential instance to CredentialCache.

// Negotiate for NTLM or Kerberos authentication.
cache.Add(new Uri(rs.Url), "Negotiate",new System.Net.NetworkCredential("username", "password", "domain"));

//Assign CredentialCache to the Web service Client Proxy(myProxy) Credetials property.
rs.Credentials = cache;


Unhandled Exception: System.Net.WebException: The request failed with HTTP status 401: Access Denied.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at ReportManager.RsService.ReportingService.ListChildren(String Item, Boolean Recursive) in c:\webprojects.n
at ReportManager.ReportHelper.GetItemList(String rootPath, ItemTypeEnum[] typeList, Boolean recursive) in c:

Thanks!

Nope, not yet...
But our next step was to override the GetWebRequest method and set the KeepAlive property of the webrequest object to false:
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
return webRequest;
}
Check out the link above in my previous post...
Let me know if it works!
thanks
Doug

Ithinkwe've found that the problem is not as I previously thought.
The software architect pointed me in this direction:
--------------------------
Make sure that the URL property of the webservice object is set to the correct url.
IE:
public QueuesWS.QueuesService qSvc =new QueuesWS.QueuesService();
qSvc.Credentials = System.Net.CredentialCache.DefaultCredentials;
qSvc.URL = "http://localhost:7506/QueuesWS/QueuesService.asmx";
--------------------------
Itseems to have helped.
For now.
God Bless.
Doug


Nope.

Still not fixed.
I was wrong (again).


Followup to my original post:
I now believe there to be a resource consumption issue in Reporting Services when you are performing a large number of management actions through the web services. Our program creates links for many users/reports and sets permissions on their folders. When it gets to a certain, reproducible point (around 300 links), the error occurs for the next 120 seconds (like clockwork). After that we can continue on for another for ~300 links.
We adjusted every RS config variable we could w/o luck. Also, we checked everything we could using perfmon.
So, I swallowed my pride :) and added a sleep for 120 seconds after every 300 links. The program takes a little while longer but at least it runs to completion w/o each night.
Hope this helps someone.
Mike