Solved

Specify Oject Name in Silverlight Enabled WCF Service

Posted on 2010-09-17
3
384 Views
Last Modified: 2012-05-10
In my Silverlight enabled WCF Service I have the following two methods GetCountyList and GetAdminCountyList (see attached code). The service appears to be naming the object County and County1. For usage in my View Model I would like to rename County1 to AdminCounty. How can I specify the object name in my service?
[OperationContract]
        public IList<County> GetCountyList(DateTime date)
        {
            IProductionManager manager = UnityManager.UnityContainer.Resolve<IProductionManager>();
            return manager.GetCountyList(date);
        }

        [OperationContract]
        public IList<Sdi.SharedObjects.Web.Objects.Entity.County> GetAdminCountyList()
        {
            IEntityManager entityManager = UnityManager.UnityContainer.Resolve<IEntityManager>();
            return entityManager.GetCountyList();
        }

Open in new window

0
Comment
Question by:farminsure
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 33704139
use the parameter "Name" in data contract.. this controls the name of the generated class at the client side
[DataContract(Name = "CompositeTypeGautham")]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }
    }

Open in new window

0
 

Author Comment

by:farminsure
ID: 33716289
Is there a way to do this at the service level instead of object leve?
0
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
ID: 33717592
no.. i don't think so..my understanding is that it has to be done at the object level.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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