Solved

Specify Oject Name in Silverlight Enabled WCF Service

Posted on 2010-09-17
3
370 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error while accessing webservices 1 66
Simple WCF web service and yet I get the infamous "The webpage cannot be found" 14 247
jquery, wcf 1 55
wcf vs wev services 2 153
This tutorial will show you how to add an attribute to an XML (http://en.wikipedia.org/wiki/XML) stream returned from a Windows Communication Foundation (http://en.wikipedia.org/wiki/Windows_Communication_Foundation) (WCF) Web Service.  Some knowled…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

863 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

27 Experts available now in Live!

Get 1:1 Help Now