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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:02:27+00:00 2026-05-22T12:02:27+00:00

I have created a simple service to provide configuration options as a Dictionary. I

  • 0

I have created a simple service to provide configuration options as a Dictionary. I created a new SerializableDictionary class that implements IXmlSerializable as described on this board. When I add the service (via “Add Service Reference” in my consumer project), the method signature shows that it returns a DataSet. When I examine the DataSet at runtime it is empty.

Here is my service:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class AppSettingsService : System.Web.Services.WebService
{
        [WebMethod]
        public SerializableDictionary<string, string> ReadAppSettings()
        {
            return AppSettings.Settings; // Settings is a SerializableDictionary<string, string>
        }
}

On the Client side I do this:

using Clients.AppSettingsServiceReference;

        static AppSettings()
        {
            AppSettingsServiceSoapClient client = new AppSettingsServiceSoapClient();
            var settings = client.ReadAppSettings();
            // ...
        }

I expect settings to be a SerializableDictionary but it’s an empty DataSet. I’ve tried sending it as a List of KeyValuePairs as suggested here and elsewhere but that also returns a DataSet. I’m using C#, ASP.Net 3.5, VS2008 Pro
I’m sure I’m overlooking something simple but I can’t find it. Can someone show me how to do this?

  • 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-22T12:02:28+00:00Added an answer on May 22, 2026 at 12:02 pm

    John Saunders is right: this isn’t really possible. The “right” way to do what you’re trying to do is to create a class that represents the key-value pairs you’re really trying to return, and then return an IEnumerable of that class. For example:

    public class AppSetting
    {
        public string Name {get;set;}
        public string Value {get;set;}
    }
    
        [WebMethod]
        public IEnumerable<AppSetting> ReadAppSettings()
        {
            return AppSettings.Settings.Select(
                kvp => new AppSetting{Name = kvp.Key, Value = kvp.Value});
        }
    

    This provides the data straight to the consumer: let them decide whether they want to represent this as a Dictionary/Hashtable, List, Array, Tree, or any other data structure they decide to make of it. All you care about from a data-integrity standpoint is making sure each key is tied to the right value.

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

Sidebar

Related Questions

I have created a simple windows service that periodically checks a remote database via
I have created a simple WordPress plugin that automatically sets my new sites up
I have created a simple web-service using Java. i want to load jars related
I am new to Repository concept and get some questions. I have created simple
i have created a simple public ref class in the vc++ project, which is
I have created a simple web service called TimeServerBean . It's working properly, the
I have a very simple WCF service that I would like to expose publicly.
I have created a WCF data service over a fairly simple EF 4.1 code
Could someone help me on this, I have created simple web services using axis2
How to manually create Friendly URLs? (PHP) So I have created simple php file

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.