Well, if this is to be a permanent WCF application, you will need to determine how you're hosting it. Is it to be self-hosted or attached to IIS?
thines01
Postaholic
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7
So, I guess we don't need to worry too much about elegance.
After you've created your base project (and compiled it), you will need to create a class and store some data in objects of that class for the service to return.
You can use a class like this inside your "Service1.svc.cs" file right after the declaration of the namespace
public class CPerson
{
public string strFirstName { get; set; }
public string strLastName { get; set; }
public CPerson()
{
strFirstName = "";
strLastName = "";
}
public CPerson(string strFirstName, string strLastName)
{
this.strFirstName = strFirstName;
this.strLastName = strLastName;
}
}
2) Populate a static dictionary, array, or list of those objects right inside your Service1 class.
3) create a public method IN your service 1 class that returns 1 of those based on either position or value
4) Modify your IService1.cs to contain an OperationContract that uses the same method signature as the method (without the public).
Let me know when you've done that.
thines01
Postaholic
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7
thines01
Postaholic
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7