473,322 Members | 1,781 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,322 software developers and data experts.

WCF : Underlying connection was closed

Hi all,

we meet a problem since we use WCF to consume java WebServices.
Often the first call works then the second raises the following error :
"The underlying connection was closed : "

We use a basicHttpBinding over HTTPS to connect to WebService. The
configuration is the following
<binding name="SoapBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:02:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536000" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536000"
messageEncoding="Text" textEncoding="utf-8"
transferMode="Buffered" useDefaultWebProxy="true" >

<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None"
proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>

We found some solution about the "KeepAlive" property of the generated proxy
but it concerns "standard" webservice. We don't know how to reproduce this on
WCF client.

Is there a solution with Binding configuration or with code ?

Thanks

Nov 26 '07 #1
4 21774
Hi Arnaud,

From your description, you're using WCF basic httpbinding to consume a JAVA
webservice, however, you found the service call will always report error
"underlying connection closed..." after the first method call, correct?

As for this issue, based on my experience, it is likely the underlying soap
request(from WCF to JAVA side) or the soap response(from JAVA side to WCF)
doesn't quite meet the receiver's expected format. As you said the problem
occur after the first method call, does it occur after you make the
webservice call and haven't get the correcct response result. Or does it
occur when you make the second webservice call?

If the first call finish completely, then, is there any particular
difference between the two ones or maybe the second one may take a long
runtime time? If the problem can be isolated to method specific, we can
then concentrate on that particular webmethod.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 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 or complex
project analysis and dump analysis issues. 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/subscripti...t/default.aspx.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?QXJuYXVkIFZpc2N1c2k=?= <ho*********@newsgroup.nospam>
Subject: WCF : Underlying connection was closed
Date: Mon, 26 Nov 2007 01:32:01 -0800
Hi all,

we meet a problem since we use WCF to consume java WebServices.
Often the first call works then the second raises the following error :
"The underlying connection was closed : "

We use a basicHttpBinding over HTTPS to connect to WebService. The
configuration is the following
<binding name="SoapBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:02:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536000" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536000"
messageEncoding="Text" textEncoding="utf-8"
transferMode="Buffered" useDefaultWebProxy="true" >

<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None"
proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>

We found some solution about the "KeepAlive" property of the generated
proxy
but it concerns "standard" webservice. We don't know how to reproduce this
on
WCF client.

Is there a solution with Binding configuration or with code ?

Thanks
Nov 27 '07 #2
Hi Steven,

the first call always works and terminates correctly and we get the good
response.
Then the error on the second call occurs randomely.
The exact error is :
"The underlying connection was closed: A connection that was expected to be
kept alive was closed by the server"

We found the following solution concerning this error but it's about
"standard" webservice (not WCF) :

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

webRequest.KeepAlive = false;
webRequest.ProtocolVersion=HttpVersion.Version10;
return webRequest;
}

http://geekswithblogs.net/denis/arch.../16/50365.aspx

Do you think there's a way to accomplish this with WCF ? Or is it a problem
with our configuration ? Could the problem come from the JAVA side ?

Thanks

"Steven Cheng[MSFT]" wrote:
Hi Arnaud,

From your description, you're using WCF basic httpbinding to consume a JAVA
webservice, however, you found the service call will always report error
"underlying connection closed..." after the first method call, correct?

As for this issue, based on my experience, it is likely the underlying soap
request(from WCF to JAVA side) or the soap response(from JAVA side to WCF)
doesn't quite meet the receiver's expected format. As you said the problem
occur after the first method call, does it occur after you make the
webservice call and haven't get the correcct response result. Or does it
occur when you make the second webservice call?

If the first call finish completely, then, is there any particular
difference between the two ones or maybe the second one may take a long
runtime time? If the problem can be isolated to method specific, we can
then concentrate on that particular webmethod.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 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 or complex
project analysis and dump analysis issues. 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/subscripti...t/default.aspx.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?QXJuYXVkIFZpc2N1c2k=?= <ho*********@newsgroup.nospam>
Subject: WCF : Underlying connection was closed
Date: Mon, 26 Nov 2007 01:32:01 -0800
Hi all,

we meet a problem since we use WCF to consume java WebServices.
Often the first call works then the second raises the following error :
"The underlying connection was closed : "

We use a basicHttpBinding over HTTPS to connect to WebService. The
configuration is the following
<binding name="SoapBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:02:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536000" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536000"
messageEncoding="Text" textEncoding="utf-8"
transferMode="Buffered" useDefaultWebProxy="true" >

<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None"
proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>

We found some solution about the "KeepAlive" property of the generated
proxy
but it concerns "standard" webservice. We don't know how to reproduce this
on
WCF client.

Is there a solution with Binding configuration or with code ?

Thanks

Nov 27 '07 #3
Thanks for your reply Arnaud,

So far from such appearnce behavior, it's difficult to determine the exact
cause. If the first and second webmethods call doesn't have particular
difference(e.g. you can still get the same behavior even if you call the
same method twice), you may capture the XML soap message to inspect whether
the two method calls have different underlying XML soap messages. Since raw
xml maybe complex, it is recommend that you try repro the problem through
two simplified webservice methods.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?QXJuYXVkIFZpc2N1c2k=?= <ho*********@newsgroup.nospam>
References: <B9**********************************@microsoft.co m>
<jD**************@TK2MSFTNGHUB02.phx.gbl>
Subject: RE: WCF : Underlying connection was closed
Date: Tue, 27 Nov 2007 01:22:02 -0800

Hi Steven,

the first call always works and terminates correctly and we get the good
response.
Then the error on the second call occurs randomely.
The exact error is :
"The underlying connection was closed: A connection that was expected to be
kept alive was closed by the server"

We found the following solution concerning this error but it's about
"standard" webservice (not WCF) :

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

webRequest.KeepAlive = false;
webRequest.ProtocolVersion=HttpVersion.Version10;
return webRequest;
}

http://geekswithblogs.net/denis/arch.../16/50365.aspx

Do you think there's a way to accomplish this with WCF ? Or is it a problem
with our configuration ? Could the problem come from the JAVA side ?

Thanks

"Steven Cheng[MSFT]" wrote:
Hi Arnaud,

From your description, you're using WCF basic httpbinding to consume a
JAVA
webservice, however, you found the service call will always report error
"underlying connection closed..." after the first method call, correct?

As for this issue, based on my experience, it is likely the underlying
soap
request(from WCF to JAVA side) or the soap response(from JAVA side to
WCF)
doesn't quite meet the receiver's expected format. As you said the
problem
occur after the first method call, does it occur after you make the
webservice call and haven't get the correcct response result. Or does it
occur when you make the second webservice call?

If the first call finish completely, then, is there any particular
difference between the two ones or maybe the second one may take a long
runtime time? If the problem can be isolated to method specific, we can
then concentrate on that particular webmethod.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
where an initial response from the community or a Microsoft Support
Engineer within 1 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 or complex
project analysis and dump analysis issues. 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/subscripti...t/default.aspx.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
>
--------------------
From: =?Utf-8?B?QXJuYXVkIFZpc2N1c2k=?= <ho*********@newsgroup.nospam>
Subject: WCF : Underlying connection was closed
Date: Mon, 26 Nov 2007 01:32:01 -0800
Hi all,

we meet a problem since we use WCF to consume java WebServices.
Often the first call works then the second raises the following error :
"The underlying connection was closed : "

We use a basicHttpBinding over HTTPS to connect to WebService. The
configuration is the following
<binding name="SoapBinding" closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:02:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536000" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536000"
messageEncoding="Text" textEncoding="utf-8"
transferMode="Buffered" useDefaultWebProxy="true" >

<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None"
proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>

We found some solution about the "KeepAlive" property of the generated
proxy
but it concerns "standard" webservice. We don't know how to reproduce
this
on
WCF client.

Is there a solution with Binding configuration or with code ?

Thanks

Nov 29 '07 #4
I solved this problem with my web services by calling Discover() method:

YourWebService ws = new YourWebService ();
ws.Discover();

just before calling the service webmethods

Feb 6 '08 #5

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

Similar topics

2
by: Rajiv | last post by:
Hello, I developed a No touch deployment client which accesses data through a web service. The application worked really well until I installed .NET framework 1.1 SP1. It worked well without the...
26
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
5
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...
0
by: Matthew B. Lehrman | last post by:
I've googled all over the place trying to get answer to this question and some things have come close, but nothing quite. Asp.NET 1.1, Visual Studio 2003 I am writing Visual Basic apps. I can...
0
by: Apu Nahasapeemapetilon | last post by:
Why do I get the following two error messages, intermittently, when I issue a "SendRequestResponse(methodName, requestEnvelope);" command on a class derived from...
2
by: =?Utf-8?B?RnJpZWRoZWxtRWljaGlu?= | last post by:
I am consuming continously my own web-services on a localhost client with a rate of perhaps 35 request/response-pairs a minute. I am using "invoke-id=1", so there is at the same time only one...
0
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...
4
by: Sin Jeong-hun | last post by:
I don't get the message so it's hard to debug that, but some of my clients report that they get "The underlying connection was closed unexpectedly" exception. According to this site (http://...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.