We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,171 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

WCF project

Hi!

Im new on this forum.. so Hello to all :)

Im a beginner in programming WCF.Im a student, on our faculty, we get a new task to make a project in WCF.I hope that you guys could help me a little bit..I dont know how to start.I watched some toturials on youtube and so on..

So here is my task:


Create Web services using Windows Communication Foundation framework - WCF.

In Visual Studio select the WCF Service Application project and add a new service, provided with a service, operations and data contract. The service must have parameters and return values ​​in the form of objects.

Create a synchronous and asynchronous client to initiate service. Place a full solution that covers both service and client.

2
Contributors
6
Replies
1 Day
Discussion Span
1 Year Ago
Last Updated
8
Views
diGGity
Newbie Poster
10 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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
Team Colleague
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7

No its not gonna be permanent.. its must be self hosted i think.Beacuse our profesor just check if program working properly.

diGGity
Newbie Poster
10 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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
Team Colleague
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7

Ive made the project, some toturials helped me, i hope that i did the right thing :) thx for help anyway.

diGGity
Newbie Poster
10 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

You're finished?

thines01
Postaholic
Team Colleague
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7

You're finished?

Yes :)

diGGity
Newbie Poster
10 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.3138 seconds using 2.73MB