<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://v900u039rux.maximumasp.com/Web/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>hB0 : DotNet</title><link>http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/tags/DotNet/default.aspx</link><description>Tags: DotNet</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>Web Service Connection/Timeout problems in Dot .Net 1.1</title><link>http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/2007/12/21/web-service-connection-timeout-problems-in-dot-net-1-1.aspx</link><pubDate>Fri, 21 Dec 2007 15:12:00 GMT</pubDate><guid isPermaLink="false">3790bee0-d05b-4b84-a272-3ed522a0473a:121</guid><dc:creator>hB0</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/hb0/rsscomments.aspx?PostID=121</wfw:commentRss><comments>http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/2007/12/21/web-service-connection-timeout-problems-in-dot-net-1-1.aspx#comments</comments><description>&lt;p&gt;Issue:&lt;br /&gt;The underlying connection was closed: An unexpected error occurred on a receive.&lt;br /&gt;Web Service Timeout problems occurring on Client and Server sides.&lt;br /&gt;Server =&amp;gt; Web Service Host&lt;br /&gt;Client =&amp;gt;   Web Service Caller&lt;br /&gt;&lt;br /&gt;*&lt;br /&gt;The underlying connection was closed: An unexpected error occurred on a receive.&lt;br /&gt;This is a client side problem.&lt;br /&gt;And it can be solved by avoiding HTTP KeepAlives - with Dot Net 1.1&lt;br /&gt;&lt;br /&gt;For other issues we need to increase the timeout values at various levels.&lt;br /&gt;&lt;br /&gt;*&lt;br /&gt;For Server side, adjust the proper connection timeout value in the IIS web server properties.&lt;br /&gt;*&lt;br /&gt;if the request takes too long on the server, the web server could time it out.&lt;br /&gt;*&lt;br /&gt;Also adjust this value:  in the config file (web/app .config) (Read more on msdn)&lt;br /&gt;The default is value 110, a little less than 2 minutes.  See documentation for detail.&lt;br /&gt;&lt;br /&gt;For Client Side (Timeout: &amp;#39;give up on the server if you don&amp;#39;t get a reply back with a certain time&amp;#39;.);&lt;br /&gt;To specify the amount of time to wait for the request to complete, use the &lt;span style="font-weight:bold;"&gt;Timeout &lt;/span&gt;property.&lt;br /&gt;A
Domain Name System (DNS) query may take up to 15 seconds to return or
time out. If your request contains a host name that requires resolution
and you set Timeout to a value less than 15 seconds, it may take 15
seconds or more before &lt;span style="font-style:italic;"&gt;a WebException is thrown to indicate a timeout on your request.&lt;/span&gt;&lt;br /&gt;*&lt;br /&gt;There are two timeout values that need to be adjusted based on the situation.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Timeout, ReadWriteTimeout&lt;/span&gt;&lt;br /&gt;*&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;HttpWebRequest.Timeout&lt;/span&gt; = The number of milliseconds to wait before the request times out. The default is 100,000 milliseconds (100 seconds).&lt;br /&gt;*&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;HttpWebRequest.ReadWriteTimeout&lt;/span&gt;
= ReadWriteTimeout property controls the time-out for the Read method,
which is used to read the stream returned by the GetResponseStream
method, and for the Write method, which is used to write to the stream
returned by the GetRequestStream method.&lt;br /&gt;Or simply &amp;#39;The number of
milliseconds before the writing or reading times out. The default value
is 300,000 milliseconds (5 minutes).&amp;#39;&lt;br /&gt;&lt;br /&gt;Adjust these values before calling the Web Service (Method) or before making the WebRequest.&lt;br /&gt;&lt;br /&gt;*&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;WebClientProtocol.Timeout&lt;/span&gt; Property&lt;br /&gt;The time out in milliseconds, for synchronous calls to the XML Web service. The default is 100000 milliseconds.&lt;br /&gt;(&lt;span style="font-style:italic;"&gt;WebClientProtocol&lt;/span&gt;: Specifies the base class for all XML Web service client proxies created using ASP.NET.)&lt;br /&gt;Setting
the Timeout property to Timeout.Infinite indicates that the request
does not time out. Even though an XML Web service client can set the
Timeout property to not time out, the Web server can still cause the
request to time out on the server side.&lt;br /&gt;Note that:&lt;br /&gt;WebClientProtocol&lt;br /&gt;-&amp;gt;HttpWebClientProtocol&lt;br /&gt; |-&amp;gt;SoapHttpClientProtocol&lt;br /&gt;   |-&amp;gt;WebServicesClientProtocol&lt;br /&gt;     |-&amp;gt;WebServiceClass&lt;br /&gt;&lt;br /&gt;These
properties of the WebClientRequest class and its derived classes all
map to properties on the corresponding System.Net.WebRequest and
derived classes.&lt;br /&gt;&lt;br /&gt;*&lt;br /&gt;I guess all this text above combined together would be helpful as it is described in a plain programmers way.&lt;br /&gt;&lt;br /&gt;Further:&lt;br /&gt;http://www.thescripts.com/forum/thread425852.html&lt;br /&gt;http://www.thescripts.com/forum/thread427678.html&lt;br /&gt;HttpWebRequest.ReadWriteTimeout Property&lt;br /&gt;http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.readwritetimeout.aspx&lt;br /&gt;HttpWebRequest.Timeout Property&lt;br /&gt;http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.timeout.aspx&lt;br /&gt;&lt;br /&gt;Please do not hesitate to ask/discuss it any further through your comments.&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;hB &lt;/p&gt;&lt;img src="http://v900u039rux.maximumasp.com/Web/aggbug.aspx?PostID=121" width="1" height="1"&gt;</description><category domain="http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/tags/DotNet/default.aspx">DotNet</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/tags/Timeout/default.aspx">Timeout</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/tags/WebService/default.aspx">WebService</category></item><item><title>Source Code for the .NET</title><link>http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/2007/10/05/source-code-for-the-net.aspx</link><pubDate>Fri, 05 Oct 2007 23:50:00 GMT</pubDate><guid isPermaLink="false">3790bee0-d05b-4b84-a272-3ed522a0473a:74</guid><dc:creator>hB0</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/hb0/rsscomments.aspx?PostID=74</wfw:commentRss><comments>http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/2007/10/05/source-code-for-the-net.aspx#comments</comments><description>&lt;p&gt;With the release of Visual Studio 2008, Microsoft will be releasing the source code for the .NET Framework Libraries.&lt;br /&gt;The ability to be able to debug through your application and then right in to the framework itself will be a huge benefit for developers.&lt;/p&gt;&lt;p&gt;Initially the source code released will be for the following libraries;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * .NET Base Class Libraries (including System, System.Net, System.Security, etc.)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * ASP.NET (System.Web)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Windows Forms (System.Windows.Forms)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * ADO.NET (System.Data)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * XML (System.XML)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Windows Presentation Foundation aka WPF (System.Windows)&lt;/p&gt;&lt;p&gt;View the detailed info @ &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx" target="_blank"&gt;Releasing the Source Code for the .NET Framework Libraries - ScottGu&amp;#39;s Blog&lt;/a&gt;&lt;/p&gt;&lt;img src="http://v900u039rux.maximumasp.com/Web/aggbug.aspx?PostID=74" width="1" height="1"&gt;</description><category domain="http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/tags/DotNet/default.aspx">DotNet</category></item><item><title>Process XML Dot Net -&gt; Parse to Object</title><link>http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/2007/09/11/process-xml-dot-net-gt-parse-to-object.aspx</link><pubDate>Tue, 11 Sep 2007 04:19:00 GMT</pubDate><guid isPermaLink="false">3790bee0-d05b-4b84-a272-3ed522a0473a:65</guid><dc:creator>hB0</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/hb0/rsscomments.aspx?PostID=65</wfw:commentRss><comments>http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/2007/09/11/process-xml-dot-net-gt-parse-to-object.aspx#comments</comments><description>&lt;p&gt;Here we consider a small aspect found while parsing XML string.&lt;br /&gt;
We are using Dot Net (1.1) but we process xml in general (non-dotnet specific version) using the XPath expressions.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;Situation is we have XML string format as:&lt;br /&gt;
&amp;lt;ns:XMLMessage xmlns:ns=&amp;quot;http://domain.com/codename/MessagesXMLSchema.xsd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns:EventType&amp;gt;task&amp;lt;/ns:EventType&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns:EventName&amp;gt;TASK_COMPLETE&amp;lt;/ns:EventName&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns:JobId&amp;gt;02000016000004630144000100000070&amp;lt;/ns:JobId&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns:TaskId&amp;gt;02000016000004630154000200000070&amp;lt;/ns:TaskId&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns:EventDateTime&amp;gt;2007-09-06T15:26:25+04:00&amp;lt;/ns:EventDateTime&amp;gt;&lt;br /&gt;
&amp;lt;/ns:XMLMessage&amp;gt;&lt;br /&gt;
&amp;nbsp;= strXMLMsg&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;Scene 1:&lt;br /&gt;Dim xmlDoc As New Xml.XmlDocument&lt;br /&gt;xmlDoc.LoadXml(strXMLMsg)&lt;br /&gt;strXPath = &amp;quot;/XMLMessage /EventName&amp;quot;&lt;br /&gt;xmlNode = xmlDoc.SelectSingleNode(strXPath)&lt;br /&gt;strData = xmlNode.InnerText&lt;br /&gt;In this seen we will not be able to get our parsed data. And the issue is the inclusion of the namespace and its prefix.&lt;br /&gt;
So to get the parsed data correctly we have to use the way shown in scene 2.&lt;/p&gt;&lt;p&gt;Scene 2:&lt;br /&gt;
Dim xmlDoc As New Xml.XmlDocument&lt;br /&gt;
xmlDoc.LoadXml(strXMLMsg)&lt;br /&gt;
xsn = New Xml.XmlNamespaceManager(xmlDoc.NameTable)&lt;br /&gt;
XMLNamespace = &amp;quot;http://domain.com/codename/MessagesXMLSchema.xsd&amp;quot;&lt;br /&gt;
XMLNamespacePrefix = &amp;quot;ns&amp;quot;&lt;br /&gt;
xsn.AddNamespace(XMLNamespacePrefix , XMLNamespace)&lt;br /&gt;
strXPath = &amp;quot;/ns:XMLMessage /ns:EventName&amp;quot;&lt;br /&gt;
xmlNode = xmlDoc.SelectSingleNode(strXPath,xsn)&lt;br /&gt;
strData = xmlNode.InnerText&lt;br /&gt;
In this way we will get our data parsed correctly!&lt;/p&gt;&lt;p&gt;I hope the situation mentioned above is somewhat helpful.&lt;br /&gt;
Any questions/issues/suggestions/imporvements - please mention them in your comments.&lt;/p&gt;&lt;p&gt;Have a nice time.&lt;/p&gt;&lt;p&gt;---&lt;br /&gt;&lt;b&gt;
hB&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://v900u039rux.maximumasp.com/Web/aggbug.aspx?PostID=65" width="1" height="1"&gt;</description><category domain="http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/tags/XML/default.aspx">XML</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/hb0/archive/tags/DotNet/default.aspx">DotNet</category></item></channel></rss>