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

  • Home
  • SEARCH
  • 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 7537329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:49:24+00:00 2026-05-30T06:49:24+00:00

I have created a REST Web Service that in all other ways is working

  • 0

I have created a REST Web Service that in all other ways is working how I want it to work.

I have a main class that contains contacts, in that class, there are 2 other lists of classes that I have created.
My main class, and one of the lists comes through the call with all information intact. However, the second class is comming through as empty. It has each item in the list, but each list item is empty.

Web Service Function

        [OperationContract]
        [WebGet(UriTemplate = "/Login/{IQPid}/{Password}")]
        public IQP_Contacts Login(string IQPid, string password)
        {
            int iqpID = 0;
            try
            {
                iqpID = int.Parse(IQPid);
            }
            catch { return null; }
            IQP_Contacts contact = this.Repository.Contacts.Find(delegate(IQP_Contacts c) { return c.IqpID == iqpID; });
            if (contact.Password == password)
            {
                return contact;
            }
            else return null;
        }

Code calling the web service

           WebClient proxy = new WebClient();
            byte[] abc = proxy.DownloadData((new Uri("http://localhost:53468/IQP_Service.svc/Login/" + ID + "/" + password )));

            Stream strm = new MemoryStream(abc);
            DataContractSerializer obj = new DataContractSerializer(typeof(IQP_Contacts));
            IQP_Contacts contact = (IQP_Contacts)obj.ReadObject(strm);

As you can see below, my webservice’s class contains the information, but the the webpage does not

Web Service

Website


If anyone has any ideas, Please let me know. I am lost on this one. Something this simple shouldn’t be this broken. Thanks

  • 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-30T06:49:27+00:00Added an answer on May 30, 2026 at 6:49 am

    Check out the documentation about DataContractSerializer to see what does and does not get serialized by default:
    http://msdn.microsoft.com/en-us/library/cc656732.aspx

    It is hard to tell without seeing your classes. But it is possible that your Files property is readonly (only has a get accesser with no set) then it would not get serialized.

    It could also depend on if you have selectively applied [DataContract]/[DataMember] attributes on your classes. This affects the behavior of what DataContractSerializer will serialize/deserialize. You would need to indicate that your “Files” property on IQP_RestWebService.Entitys.IQP_Contacts class is marked with a [DataMember] attribute and that you have a [DataContract] on the IQP_RestWebService.Entitys.Files class.

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

Sidebar

Related Questions

I have created a REST web service that, on Application_Start, subscribes to another service
I have a serializable dictionary that I created for a WCF REST web service
So I have this service class that utilize Restkit to consume REST web services.
I have created a REST web service and successfully used it with a client.
I have a REST web-service interface that calls-down to a service layer which orchestrates
I have a REST web service that creates a XMLDocument I am a bit
I have created a simple Northwind's Product REST Web Service in WCF at /Northwind/Product
I have an ASP.NET MVC web application that makes REST style web service calls
Let's assume that I have created my REST service smoothly and I am returning
Let's assume that I have created my REST service smoothly and I am returning

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.