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 6749849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:44:20+00:00 2026-05-26T12:44:20+00:00

Here is the code trying from compact framework to get http service.. List<Table> tables;

  • 0

Here is the code trying from compact framework to get http service..

    List<Table> tables;
    using (Stream r = response.GetResponseStream())
    {
        XmlSerializer serializer = new XmlSerializer(typeof(Table),"http://schemas.datacontract.org/2004/07/");
        tables=(List<Table>) serializer.Deserialize(r);
    }

   response.Close();

It fails with {“There is an error in XML document (1, 2).”}

{"<ArrayOfTable xmlns='http://schemas.datacontract.org/2004/07/WpfApplication1.Data.Model'> was not expected."}

Table namespace is the same…
I dont know whats wrong there…

UPDATE

Problem was that i had typeof(Table) not typeof(List<Table>) which works partially.. No error but created tables values are null!

  • 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-05-26T12:44:20+00:00Added an answer on May 26, 2026 at 12:44 pm

    The second parameter on the XmlSerializer constructor works for both serializing and deserializing. So, on the second parameter (the namespace) should be the same to the one being received. So you’ll end up having:

    XmlSerializer serializer = new XmlSerializer(typeof(Table),"http://schemas.datacontract.org/2004/07/WpfApplication1.Data.Model")
    

    Note the “WpfApplication1.Data.Model” at the end of the namespace string.

    One way to get rid of the namespace thing. Is to specify on your model class (Table) that it should not use a namespace:

    [DataContract(Namespace = "")]
    public class Table { ... }
    

    That way you don’t need to specify the namespace for deserialization.

    Hope it helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get some form data from POST method. Here's the code
I am trying to use the jQuery CSV plugin, as documented here: http://code.google.com/p/js-tables/wiki/CSV According
here is my code , i am trying to get from one view to
I am trying to retrieve a value from an Array. Here is the code:
I'm trying to play a sound file from an iPhone program. Here's the code:
I'm trying to use DirectSound to capture sound from a microphone. Here's my code:
I am trying to understand this inline assembly code which comes from _hypercall0 here
I am trying to test some of these code here http://ha.ckers.org/xss.html on my code.
I'm trying to use the geocoding code from here in my ASP.NET MVC 2
What am I doing wrong here? I am trying to extract from this list

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.