Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6795347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:20:00+00:00 2026-05-26T18:20:00+00:00

I am currently developing a C# Windows Form Application that I intend to let

  • 0

I am currently developing a C# Windows Form Application that I intend to let it interact with a server. The server will receive posting from a mobile application that I have developed and whenever a posting is received, my Windows Form Application should be notified and give me a notification.

E.g. My mobile application sends an message over to my server. Once my server receives the message, my windows form application should display a new notification showing the content of the message received.

I am now starting to develop my WCF Service and this is what I’ve done so far

[ServiceContract(Namespace = "Posting")]
public interface IPostingService
{
    [OperationContract]
    void NotifyAboutPosting(Posting post);
}

[DataContract]
public class Posting
{
    [DataMember]
    public int ID { get; set; }
    [DataMember]
    public string Description { get; set; }
    [DataMember]
    public DateTime PostingTimestamp { get; set; }
}

class Program
{
    static void Main(string[] args)
    {
        Uri baseAddress = new Uri("http://localhost/");

        ServiceHost selfHost = new ServiceHost(typeof(Posting), baseAddress);

        try
        {

            // Step 3 of the hosting procedure: Add a service endpoint.
            selfHost.AddServiceEndpoint(
                typeof(IPostingService),
                new WSHttpBinding(),
                "Posting");


            // Step 4 of the hosting procedure: Enable metadata exchange.
            ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
            smb.HttpGetEnabled = true;
            selfHost.Description.Behaviors.Add(smb);

            // Step 5 of the hosting procedure: Start (and then stop) the service.
            selfHost.Open();
            Console.WriteLine("The service is ready.");
            Console.WriteLine("Press <ENTER> to terminate service.");
            Console.WriteLine();
            Console.ReadLine();

            // Close the ServiceHostBase to shutdown the service.
            selfHost.Close();
        }
        catch (CommunicationException ce)
        {
            Console.WriteLine("An exception occurred: {0}", ce.Message);
            selfHost.Abort();
        }

    }
}

regarding the posting class, what I want to ask is that are the methods inside used to get the information from the server?

and how do I proceed on from here after the service is done. (My winform application has been finished and all thats left is to add in this logic to receive the posting whenever the mobile app sends to the server.

and there seems to be a compilation error of

The contract name ‘##.IPostingService’ could not be found in the list of contracts implemented by the service ‘##.Posting’.

could anyone help me with this? thanks a million!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:20:00+00:00Added an answer on May 26, 2026 at 6:20 pm

    Where is your actual implementation? You have contract (IPostingService), data (Posting)… but where’s code doing the work? You seem to lack contract implementation:

    public class PostingService : IPostingService
    {
        public void NotifyAboutPosting(Posting post)
        {
            // do something with post here
        }
    }
    

    And you register actual worker class (not data) when setting up your host:

    ServiceHost selfHost = new ServiceHost(typeof(PostingService), baseAddress);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing a C# Windows Form Application that I intend to let
I am currently developing a C# Windows Form Application that I intend to let
I am currently developing a C# Windows Form Application that I intend to let
I am currently developing a C# Windows Form Application that I intend to let
I am currently developing a C# Windows Form Application that I intend to let
Currently I am developing a windows form application in c# that has several forms.
I am developing an application that will be running behind the scenes in Windows
I'm currently developing a application where I will have multiple windows open using C#
I am currently developing a C# Windows Form Application. Now I am trying to
I am currently developing a C# Windows Form Application. After the user has login

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.