WCF DataContract help needed

Posted on 2009-02-08
Last Modified: 2013-12-16
Hi all,
i'm just learning the basics of WCF and i've managed to create a basic service.  But what i'd like to do is store some settings in an XSD file and the client would be able to query those server settings.
can assistance on this?i wish to be able to query servername and current servertime.
from my basic knowledge, i assume i need something like...(see code)

but how do i go about storing that data in an xml file on the WCF host side?

thanks in advance


    public class DataContract1


        string ServerAlias;

        datetime ServerTime;


        public string ServerAlias


            get { return ServerAlias; }

            set { ServerAlias= value; }



        public datetime ServerTime


            get { return ServerTime; }

            set { ServerTime = value; }



Open in new window

Question by:zell71
    1 Comment
    LVL 11

    Accepted Solution

    You can write an XML file on setup, or on server init and you can read the nodes that you store.

    For the server time you can also get the machine date/time on which is installed by returning on the ServerTime property DateTime.Now;

    Hope this helps!

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now