Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8867393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:01:08+00:00 2026-06-14T17:01:08+00:00

I am getting a invalidoperation exception when I try to Deserialize a webresponse. In

  • 0

I am getting a invalidoperation exception when I try to Deserialize a webresponse.

In this webresponse I get an XML page which send over https.
What my code does is basically send a webrequest to get login-cookies, then another request to get an XML page, afterwards i deserialize that page.

The problem occurs when I try to deserialize, it gives me the following error:

There is an error in XML document (1, 1).

First I looked into my webresponse to see if it has proper data. So I put my webresponse into the streamreader and used readToEnd to convert it into string. Like so:

dim myStringResult as String = myStreamReader.ReadToEnd()

It gave me some letters numbers and blocks. So I think the response I get is the problem. I checked it out with Fiddler and saw that the response needed to be decoded before I could see the content(and yes it did have the proper response I wanted). I went a little deeper into the exception and saw it says

hexadecimal value 0x1F, is an invalid character. Line 1, position 1

I tried looking into the System.Text.Encoding, but couldn’t find anything for hexadecimal.
Can anyone help me with this?

edit: It’s possible that I have to decode it because it is a https response and not because it’s hexadecimal encoded.

edit1: I have tried HttpUtility.HtmlDecode unfortunately it didnt change the string.

edit2: example of data i am getting

{� �U�r�0��+(g���(J��ԙ$�k;IomR& �I�N?���/� 6���L�^`���

it doesn’t show the data right. It suppose to be mostly squars. Every now and then you see

edit: the header

content-disposition: : attachment; filename="document.xml"
CachingModuleShouldWork: true
Content-Language: en-US

Vary: Accept-Encoding,User-Agent

Content-Length: 382 Content-Type: application/xml

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:01:09+00:00Added an answer on June 14, 2026 at 5:01 pm

    0x1f is a Windows control character. It is not valid XML.

    You need to decode it first using something like HttpUtility.Decode

    So: get your response and read it into a string using a StreamReader then do something like:

    StringWriter myWriter = new StringWriter();
             // Decode the encoded string.
             HttpUtility.HtmlDecode(myEncodedString, myWriter);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting an exception with this code; InnerException: System.InvalidOperationException Message=The specified type was not
This has been driving me nuts. I keep getting the following exception System.InvalidOperationException: The
I am getting this error when I try to set a mock to have
I've been getting this error recently, after several reloads of the same page: System.InvalidOperationException:
In this code: private async void button1_Click(object sender, EventArgs e) { try { await
I m executing the follwing code: private static T FooException<T>(this IEnumerable<T> enum_in) { try
Getting red warning message that expected identifier for this statement CALayer = ImageView.layer; Using
Getting this out of the way; I don't frequently do much in php or
Getting sick with asp.net permission madness... This time, I Just cant AJAX-CALL any kind
I am trying to implement this MVVM pattern for the WPF form closing which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.