Posts

Showing posts with the label Dot Net

Web Service Connection problems Dot .Net 1.1

Issue: The underlying connection was closed: An unexpected error occurred on a receive. Web Service Timeout problems occurring on Client and Server sides. Server => Web Service Host Client => Web Service Caller * The underlying connection was closed: An unexpected error occurred on a receive. This is a client side problem. And it can be solved by avoiding HTTP KeepAlives - with Dot Net 1.1 For other issues we need to increase the timeout values at various levels. * For Server side, adjust the proper connection timeout value in the IIS web server properties. * if the request takes too long on the server, the web server could time it out. * Also adjust this value: in the config file (web/app .config) (Read more on msdn) The default is value 110, a little less than 2 minutes. See documentation for detail. For Client Side (Timeout: 'give up on the server if you don't get a reply back with a certain time'.); To specify the amount of time to wait for the request to comp...

Process XML in Dot Net -> Parse to Object

Here we consider a small aspect found while parsing XML string. We are using Dot Net (1.1) but we process xml in general (non-dotnet specific version) using the XPath expressions. Situation is we have XML string format as: task TASK_COMPLETE 02000016000004630144000100000070 02000016000004630154000200000070 2007-09-06T15:26:25+04:00 = strXMLMsg Scene 1: Dim xmlDoc As New Xml.XmlDocument xmlDoc.LoadXml(strXMLMsg) strXPath = "/XMLMessage /EventName" xmlNode = xmlDoc.SelectSingleNode(strXPath) strData = xmlNode.InnerText 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. So to get the parsed data correctly we have to use the way shown in scene 2. Scene 2: Dim xmlDoc As New Xml.XmlDocument xmlDoc.LoadXml(strXMLMsg) xsn = New Xml.XmlNamespaceManager(xmlDoc.NameTable) XMLNamespace = "http://domain.com/codename/MessagesXMLSchema.xsd" XMLNamespacePrefix = "ns" xsn.AddNamespac...