.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Unable to read my RSS feed with XmlReader

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net


I have an RSS-feed page, which I developed with SyndicationFeed class. The page seems to work, and if I type the url into a browser, a page similar to this opens up: http://msdn.microsoft.com/en-us/magazine/rss/default.aspx

However, I'm unable to read the feed into an XmlReader object. Let's say my rss page is "http://mysite/rss.aspx", and my code in the rss-retriever side is something like this:

XmlReader reader = XmlReader.Create("http://mysite/rss.aspx");

XmlDocument doc = new XmlDocument();


I get an error on doc.Load(reader) method:

For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into XmlReader.Create method

I've tried to set the ProhibitDtd to false, but then I get some other error.

If I put something like this, I can save the xml dat into a file, and I can see that it's just like it should be:

XmlReader reader = XmlReader.Create("http://mysite/rss.aspx");

SyndicationFeed feed = new SyndicationFeed();

View Complete Post

More Related Resource Links

Unable to read beyond the end of the stream in asp.net 2.0/C# web application


Hi All,

Thank you for advance.

I got the forllowing error in my asp.net 2.0/c# web application,

Message: Unable to read beyond the end of the stream.

Source: mscorlib

TargetSite: Void EndOfFile()

StackTrace:    at System.IO.__Error.EndOfFile()
   at System.IO.BinaryReader.ReadByte()
   at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
   at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
   at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
   at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
   at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
   at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
   at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
   at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
   at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)

System.IO.IOException: Unable to read data from the transport connection

Hello,   I have an xml webservice calling another xml web service and occasionally i get the following error - any ideas why?Does this happen when the request is made or when reading the response? Also how i can prevent it from happening? Thanks   System.IO.IOException: Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall. ---> System.Net.Sockets.SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)   --- End of inner exception stack trace ---   at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)   at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean readToUserBuffer)   at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)   at System.Xml.XmlTextReaderImpl.ReadData()   at System.Xml.XmlTextReaderImpl.InitTextReaderInput(String baseUriStr, TextReader input)   at System.Xml.XmlTextReaderImpl..ctor(String url, TextReader input, XmlNameTable nt)   at System.Xml.XmlTextReader..ctor(TextReader input)   at System.Web.Services.Protocols.SoapHttpClientProtocol.GetReaderForMessage(SoapClientMessage message, I

Unable to enter the product key in the Convert License Type page (textbox is read-only)

We installed both WSS and MOSS SP2 and had planned to follow the manual fix for the known issue that the patch unexpectedly activates a trial expiration.  However, the textbox to enter the product key is read-only.  We have tried accessing this page using the normal administrator credentials as well as the farm account; no success.The SP2 issue and manual fix is detailed here, http://support.microsoft.com/default.aspx/kb/971620We were able to experience this problem on a farm running the Feb 2007 cummulative patch (version so it's not related to the SP.  But running the SP increasing the need to find the fix.Any help is appreciated,J. Aqui

Rare exception: Unable to read data from the transport connection: An existing connection was forcib

Our .NET 2.0 app relies upon the ability to download xml webpages from URLs.  At startup, we have about 6 boxes in the wild (out of thousands) that are seeing the following inner exception when they try to download an xml page.  System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. (Inner: ) System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. They can get to the URL in their browser just fine, so we know our server is working.  Furthermore, the embedded WebBrowser control in our app can pull up webpages just fine, so I don't think their firewall is blocking our app.  I'm hoping it's just some diagnosible configuration issue.  Here is the snippet of code that does the downloading: WebRequest request = WebRequest.Create(fileToDownload.SourceUri);request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);request.Timeout = (int)DefaultTimeout.TotalMilliseconds;request.Method = "HEAD";WebResponse response = request.GetResponse(); Nothing revolutionary there. (I've also tried it without the HEAD request, without keepalive, and using HTTP 1.0).  And here is the exception: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. StackTrace Infor

Unable to sort RSS feed in Web Part or SP Designer 2007

I have an RSS Moss 2007 webpart to display feeds from http://www.fujitsu.com/uk/news/pr/uk-news-pr-rss.rss but the feed is coming in reverse date order. In Sharepoint designer when I try to sort by pubDate (descending), the sort order is arbitrary and it appears that the feed is being limited in size with the latest post being some 3 years ago.

Any help would be appreciated.

System.Runtime.InteropServices.COMException (0x800A141F): Word was unable to read this document. It



I am using the Interop.word.dll in my project to generate word reports. Reports are getting with out any exception if am using 2003 ms word. If i am using 2007 word iam getting the error as


System.Runtime.InteropServices.COMException (0x800A141F): Word was unable to read this document.  It may be corrupt


Please help to get reports work well in word 2007 also.




Using XMLReader and XMLWriter to read and write to a config.xml file


I have a c# program, and I have created an initialization.xml with some attributes.  One of the attributes is an output directory location that the user enters.  I want to be able to open the init file and write this directory path to the outputLocation attribute of the init xml file.

I know how to read xml files using XMLReader and create and write new XML files with XMLWriter, but not sure how to go about open an existing file, moving to a specific attribute, and writing the value to it.

I am assuming this is pretty straight forward.



SQL server2008, CRM4.0, unable to read sql backup file when trying to restore



For a client of ours we have two CRM4.0 environments, both on a seperate domain. Domain A and Domain B.
Domain A is used for testing and developing pursoses, Domain B is the production environment.

The client has requested that we match the Domain A environment with the Domain B environment so that the testing and production evironments are the same before they continue with testing/development.

For this purpose I wanted to just copy the Domain A SQL database to the Domain B environment.

Unfortunately I am getting the following error when trying to restore the CRM4.0 SQL database of Domain A on the CRM4.0 SQL database server of Domain B.

System.Data.SqlClient.SqlError: Read on "C:\Users\Cen-Admin\Desktop\VWPCRM_MSCRM.bak" failed: 38(failed to retrieve text for this error. Reason: 15105) (Microsoft.SqlServer.Smo)

I have tried to follow these instructions but have been unable to complete them because of the fact that i cannot initiate the restore action:


The link that the error provides in the detailed desciption field provides no qlue to a solution:

on XML column


Hi all,

we have a XML column with an associated schema.

There are cases when opening the table we see "<Unable to read data>" in some rows. If we disable the schema and reopen the table, then we can see the XML values.

It's very strange, because if we paste the XML value in XMLSpy, we see it's well formed, and it acomplish the schema. And when the record is inserted, there's no message error, it looks the insertion is well-performed.



Unable to read the security policy file for trust level 'WSS_Minimal' after editing 'Alternate Ac



This is my first post, so I hope that I have picked the correct forum - it seemed the most appropriate.
I am pretty green when it comes to SharePoint admin, but as it was going so well I got a bit over-confident and tried out the 'Alternate Access Mapping'.  I didn't intend to save any changes, but I must have, because now under:

Central Administration > Operations > Alternate Access Mappings >
Edit Public Zone URLs

the 'Default' is "http://<myServer> : <port>"

and afaik there was no setting there before.  Unfortunately, I can no longer connect to http://myServer : port, although I can connect to the 'Central Administration' site on http://myServer : otherPort.  Apologies in advance for the data dump below, but if anyone has any suggestions on what I could've done (or even better what I could do to fix it before tomorrow :-) I would be very grateful.

Here are the errors that I saw/see in the browser:

SharePoint 2010 backup is failing - Error - "Unable to read full interval from database - Operation



I am having a problem backing up a site collection, when trying to backup the collection I get the following error "Unable to read full interval from database" and "operation is not valid due to the current state of the object".

The backup does run and manages to backup 182MB of the site collection and then the backup fails, it fails at the same point what ever backup method I use e.g. STSADM, Powershell or Central Admin.

I'm getting the same error whether I use CA "granular backup" or "Farm backup", and using either STSAMD or Powershell. I can backup CA or the mysite collection but not the Home Portal site collection. I even tried installing the commuvaults 2010 agents and running a commuvault backup but this is also failing. i have included the log file entry below.

Does anyone have any suggestions on what i can do to either fix the problem or an alternative way to backup the collection or farm, I am currently taking a full SQL backup but am not sure how reliable this is as I haven't tried to restore the sites. 

P.S. I am not using the "UseSQLSnapshot" parameter.

11/30/2010 09:34:25.23  OWSTIMER.EXE (0x17E8)                 

Xml Deserializing a XMLReader feed and capturing the errors if any




I have working piece of code which takes an xml feed and transfers it into an object.  This is all working and was just wondering since I am using an XMLReader is there anyway for me to capture the xml error (say if a date was 20/20/2011) and get the full xml tree that was passed.


I am basically doing the following



this I have wrapped in a try as I want to capture the error and add the failed xml subtree to an errorXml doc that is built up of all the failed updates.


I am not sure how the best way is to get the whole xml sub tree since XmlReader is read forward only?


Would it be best to get the outer xml and then convert it to the object or is there away to get it out of the exception?

Intermittent error . Unable to read data from the transport connection: An existing connection was f

We have a web application which uses sp lists web service.
1. We have a resume database (Document Library) in sharepoint
2. A .Net application uses Lists.asmx and updates the resumes DL everyday for any changes which are tracked in the Employees Database this is a table which has inforamtion of employees for changes in a seprate Database

How do read Feed Atom ?


I have search code read rss of feed atom but they only run in Net frame work 4.0, I can't used their !

I need code read with net frame work 3.5 !

How do read that's Rss : http://forum.yetanotherforum.net/yaf_rsstopic.aspx?pg=4&ft=1&f=26  ?


Serial Port Communication Read and Write using C#.net

In this simple article you will learn that how you can Open and read COM port data using System.IO.Ports Namespace.
Simply just create New Project of windows application in C#.

Import ServiceProcess APIs
using System.IO.Ports

Imports System.IO.Ports

Write Parsing functions which parse port data according to attached device

Textbox in ItemTemplate inside Gridview, unable to get the value


Hi. I have a itemtemplate inside a gridview.

<asp:TemplateField HeaderText="Enter OTP">
                            <asp:Label ID="Label2" runat="server"
                                style="font-family: Arial, Helvetica, sans-serif; font-size: x-small"
                                Text="PIN Num:"></asp:Label>
                            &nbsp;<asp:TextBox ID="txtPIN" runat="server" Height="21px" Width="100px"></asp:TextBox>

Scripts not read when in head tag


I just upgraded to VS2010 if that matters.  I'm learning JQuery and noticed that scripts don't work if they're in the head tag.  Also, I need the script tag with type="text/javascript" in the head (with nothing else) in order for the JQuery scripts in the body to work.

Very bizzare, any suggestions?

With a separate script tag in the <body> with my JQuery script, this works

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
<script type="text/javascript">

This doesn't:

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend