XMLERROR: Unexpected end of file has occurred. RRS feed

  • Question

  • I have a web service that has been running for years.. However just recently we have started having problems with Unexpected end of file errors.

    My https web service accepts a payment xml file from a vendor and processes the payment. I have been able to determine the files that are failing have encoded special characters.  If a file fails, it is saved on an FTP site that I go and pull. The strange thing, I can pull the file from the FTP site open it up copy the xml and paste it into my web service method (making no changes to the xml)  and it processes with no problem.

    This web service as I mentioned has been running without problems for years. It's a ASP .Net version  2.0.50727

    Any ideals on where and what to look for?? Any help is appreciated.



    Thursday, February 1, 2018 10:36 AM

All replies

  • hello Susan,

    If you take the saved file and without opening and copying the content to your web service, does it load using XmlDocument?  If it fails then you should be able to debug to identify what about how the encoding is causing the failure.

    Another idea is to take the xml file saved and also save the content after you open it and save it to a new file using a file comparer that will show special characters.  If you are opening in a browser and then copying the content, the content could change.

    My hunch is there is an invalid character that is confusing the xml parser you are using.


    Cheers, Jeff

    Thursday, February 1, 2018 8:36 PM
  • Hi sbrazier,

    Thank you for posting here.

    For your question is more related to ASP.NET, you could post a new thread in ASP.NET forum for suitable support.

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions. 

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 2, 2018 7:38 AM