Dot Net Dunk

Wandering in the land of .NET
posts - 42, comments - 22, trackbacks - 187

My Links

News

Archives

Post Categories

Blog Roll

Solving the BizTalk 2004, Web Services, and the "Underlying Connection was Closed" Problem

If you are consuming a remote web service from BizTalk (or ASP.NET) and you are behind a proxy server, you may receive an exception when BizTalk tries to call that web service:

System.Net.WebException - The underlying connection was closed: Unable to connect to the remote server
  
at System.Net.HttpWebRequest.CheckFinalStatus()
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult)
   at System.Net.HttpWebRequest.GetRequestStream()
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

You can fix this by altering your machine.config file to explicitly hold the proxy details, as described in KB 307220.

The problem occurs because by default machine.config instructs .NET to use the Internet Exporer proxy settings. The account under which BizTalk (and ASP.NET) is running will not have a loaded user profile, hence there are no Internet Explorer settings available to it.

Hopefully this fix, plus Jan Tielen's blog (repeated at the bottom of KB 819450), will solve most of your web service consuming problems.

Print | posted on Friday, June 25, 2004 12:40 PM | Filed Under [ BizTalk Server Nuggets ]

Feedback

Gravatar

# re: Solving the BizTalk 2004, Web Services, and the "Underlying Connection was Closed" Problem

is there a way to take care of the following error that i receive when consuming a web service from biztalk (where the request is successfully made to the web service despite this error appearing in the event log every time a request is submitted)?

Event Type: Error
Event Source: BizTalk Server 2004
Event Category: BizTalk Server 2004
Event ID: 5754
Description:
The "SOAP" adapter is suspending an outbound message going to destination URL:"https://...". Details:"The underlying connection was closed: The server committed an HTTP protocol violation.".

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
11/1/2004 3:50 PM | biztalker
Gravatar

# re: Solving the BizTalk 2004, Web Services, and the "Underlying Connection was Closed" Problem

Hi there,

I don't know the answer directly - it may be a genuine problem from the responding server. Have you tried tracing the HTTP traffic to see what response is coming back?

I know I've read articles where this relates to the "KeepAlive" property needing to be set, but beyond that and doing lots of googling, I don't know what to suggest.

If you find the solution would you post it back here for people to share?

Good luck.
11/5/2004 2:13 PM | Duncan Millard
Gravatar

# re: Solving the BizTalk 2004, Web Services, and the "Underlying Connection was Closed" Problem

I've just found this which may help: http://blogs.msdn.com/gzunino/archive/2004/09/05/225881.aspx

11/5/2004 3:15 PM | Duncan Millard
Gravatar

# How to handle Web Service status related Errors in Orchestration

1) Can any one help me I am creating a orchestration to consume a web service it is working fine, but some times the webserice is down. so i would like to trap those errors in my exception handler for the orchestration.

2) I am getting a response from web service in the form of XML String i would like to convert it into XML Document can any one help me.

6/22/2005 2:58 PM | Anu
Gravatar

# re: Solving the BizTalk 2004, Web Services, and the "Underlying Connection was Closed" Problem

hey. is there any way to set web credentials for a consumed web service (from BizTalk) for sites disallowing anonymous access? like the SoapHttpClientProtocol.Credentials?
11/1/2005 2:45 PM | thomas

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 2 and 6 and type the answer here:

Powered by: