?
Solved

WCF DataContract help needed

Posted on 2009-02-08
1
Medium Priority
?
408 Views
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

[DataContract]
    public class DataContract1
    {
        string ServerAlias;
        datetime ServerTime;
 
        [DataMember]
        public string ServerAlias
        {
            get { return ServerAlias; }
            set { ServerAlias= value; }
        }
        [DataMember]
        public datetime ServerTime
        {
            get { return ServerTime; }
            set { ServerTime = value; }
        }
    }

Open in new window

0
Comment
Question by:zell71
1 Comment
 
LVL 11

Accepted Solution

by:
Mihai Stancescu earned 100 total points
ID: 23609389
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!
Regards,
Mishu
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month14 days, 12 hours left to enroll

839 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