RE: Problems with wsdl-generated proxy clients
- From: Mark <mmodrall@xxxxxxxxxxxxx>
- Date: Wed, 8 Apr 2009 07:35:01 -0700
Hi Steven...
Like you and John, I've been perplexed on this error. It does seem size
related, as the original error only happens for the largest transaction this
user attempts. It also seems Vista-specific. I haven't been able to
reproduce it with the client on my XP machine.
I found this post that seemed related, after searching around for a while:
http://www.eggheadcafe.com/software/aspnet/31509957/an-existing-connection-wa.aspx
But having the web request.SendChunked = true; just seems to cause a lot
more problems. When chunking is on, the client gets the same error on my xp
machine but fairly randomly. It will work 3 or 4 times then break and stay
broken. When SendChunked=true, there is a record in the iis log; it has a
status 400, meaning that the request was malformed.
Without the SendChunked modification, IIS simply has no record of the
request being made.
Unfortunately the vista machine is the company executive's, so it's not easy
to commandeer it for a day for testing.
I did check the web server's event log, and there was no record of the
failing transactions there either.
I looked at the various settings you suggested. The maxRequestSize setting
says the default is 4k. You can't really do *anything* with SOAP in < 4k, so
it seems like there must be some point where it gets relaxed for a SOAP
client; the question is what does it get relaxed to?
Thanks
Mark
""Steven Cheng"" wrote:
Hi Mark,.
From your description, one of your webservice client is encountering
problem when call a certain webservice method, it received "The underlying
connection was closed: A connection that was expected to be kept alive was
closed by the server.", correct?
As for this "The underlying connection was closed......", it is a very
general error that may occur to a distributed service client when the
server side encounter some error and abort the connection. For your case,
if the data is just 100 kb, I don't think it will cause much performance
issue. However, it does be unexpected that you cannot find the request
record in IIS log. You can have a look at the server's eventlog to see
whether there is any entry indicate the IIS worker process has ever be
crashed or recycled.
If possible, you can also run a debugger(such as visual studio debugger)
against the webservices' IIS process to see whether you can get any
exceptions.
Also, for potential memory or timeout limitaion of standard ASP.NET
webservice request, you can try enlarge the value of the "executionTimeout
" and "maxRequestLength" attribute of the following <httpRuntime> element
in web.config file:
#httpRuntime Element (ASP.NET Settings Schema)
http://msdn.microsoft.com/en-us/library/e1f13641.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?TWFyaw==?= <mmodrall@xxxxxxxxxxxxx>
Subject: Problems with wsdl-generated proxy clients
Date: Tue, 7 Apr 2009 13:44:03 -0700
Hi...
We have a web service client app we use internally. One of our users was
having trouble on one specific operation (a soap request about ~100k in
size). He was getting a
System.Net.WebException: The underlying connection was closed: A connection
that was expected to be kept alive was closed by the server.
Looking at the IIS logs, I didn't even see the request in the log. I
couldn't reproduce it on my machine (xp); the other user was running Vista.
I spent an hour or so searching this morning and found a couple of threads
where other people were having the same issue on W2k and W2k3 boxes. No
one
had an explaination but one person said that, through experimentation, they
got it to work by setting the web request to SendChunked (i.e.:
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest request = base.GetWebRequest(uri) as HttpWebRequest;
request.SendChunked = true;
return request;
}
)
I tried altering our client to do this but now we're getting different
errors. It breaks on my machine and the other users. And now it shows up
in
the IIS logs for the web service - sorta. Most of the request fields are
empty, but the HTTP status shows up as 400.
So
1) What would be an issue on Vista/W2k/W2k3 that would cause network
operation aborted errors for large soap requests?
2) Why would setting SendChunked cause more blow-ups with 400 responses
(malformed request)?
3) Once an instance of a WS client gets this way, it never seems to
recover;
on client errors, are you supposed to just dispose of it and create another?
Those are the main things.
As an old question, I've tried using async operations with the client but
they never seem to complete. I fire them off and I can see the requests
complete in the web service iis logs, but the event waits never finish. Is
there some special trick you need to get async ops to work in ws clients?
Thanks
Mark
- References:
- Problems with wsdl-generated proxy clients
- From: Mark
- RE: Problems with wsdl-generated proxy clients
- From: "Steven Cheng"
- Problems with wsdl-generated proxy clients
- Prev by Date: publishing webservice
- Next by Date: WCF Is Not Processing ExchangeWebServiceMailBinding Message
- Previous by thread: RE: Problems with wsdl-generated proxy clients
- Next by thread: RE: Problems with wsdl-generated proxy clients
- Index(es):
Relevant Pages
|