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

  • SEARCH
  • Home
  • 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 5934037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:03:27+00:00 2026-05-22T15:03:27+00:00

server client architecture. No IIS involved. Both applications are WinForm! I’ve made the following

  • 0

server client architecture. No IIS involved. Both applications are WinForm!

I’ve made the following interfaces in a shared Library:

[ServiceContract(SessionMode=SessionMode.Required,
        CallbackContract=typeof(ClientInterface))]
    public interface RequestInterface
    {
        [OperationContract]
        void Subscribe();

        [OperationContract]
        MyInterface GetInterface();
    }

    public interface MyInterface
    {
        [DataMember]
        List<MySubInterface> SubClasses{get;}
    }

    public interface MySubInterface
    {
        [DataMember]
        int Value { get; }
    }

And implemented them on the server like this:

public class RequestHandler : RequestInterface
{
    private List<ClientInterface> iClients = new List<ClientInterface>();

    public MyInterface GetInterface()
    {
        List<MySubInterface> tList = new List<MySubInterface>();
        Form1.AddText("method invoked by:" + Thread.CurrentContext.ToString());
        foreach (RealSubclass tClass in Form1.iClass.SubClasses)
        {
            tList.Add(new TransmissionSubclass(tClass.Value));
        }

        TransmissionClass tTC = new TransmissionClass(tList);
        Form1.AddText("created:" + tTC);
        return tTC;
    }
    public void Subscribe()
    {
        Form1.AddText("subscribing:" + OperationContext.Current.GetCallbackChannel<ClientInterface>());
        iClients.Add(OperationContext.Current.GetCallbackChannel<ClientInterface>());
        fireClassEvent("halloWelt");
    }
}

On the client I’m doing the following piece of code, trying to invoke the GetInterface() method:

        ClientClass tClass = new ClientClass(this);
        DuplexChannelFactory<RequestInterface> pipeFactory =
         new DuplexChannelFactory<RequestInterface>(
            tClass,
            new NetNamedPipeBinding(),
            new EndpointAddress(
               "net.pipe://localhost/Request"));

        RequestInterface pipeProxy = pipeFactory.CreateChannel();

        //pipeProxy.Subscribe(); -- works like a charm
        MyInterface tInterface = pipeProxy.GetInterface(); // doesn't work
        fillListView(tInterface);

However, when debugging through the client step by step the debugging breaks at the marked line and seems to exit this function.
It only returns to ‘step by step’ mode when I close the application’s form.
On the other hand I can see from logging output on my server, that the GetInterface() method gets executed.
The TransmissionClass and TransmissionSubclass are both in the shared library and implement MyInterface / MySubInterface

[DataContract]
[Serializable]
public class TransmissionClass : MyInterface
{
    [DataMember]
    public List<MySubInterface> SubClasses{get;private set;}

    public TransmissionClass(List<MySubInterface> aList)
    {
        SubClasses = aList;
    }

    public override string ToString()
    {
        return "TransmissionClass,Count:" + SubClasses.Count;
    }
}

WCF-initialization on the server side:

using (ServiceHost host = new ServiceHost(
            typeof(RequestHandler),
            new Uri[] { new Uri("net.pipe://localhost") }))
                    {

                        ServiceDebugBehavior tBehavior = new ServiceDebugBehavior();
                        if (null == tBehavior)
                        {
                            host.Description.Behaviors.Add(new ServiceDebugBehavior() { IncludeExceptionDetailInFaults = true });
                        }
                        else if (!tBehavior.IncludeExceptionDetailInFaults)
                        {
                            tBehavior.IncludeExceptionDetailInFaults = true;
                        }
                        host.AddServiceEndpoint(typeof(RequestInterface),
                          new NetNamedPipeBinding(), "Request");

                        host.Open();
                        Application.Run(new Form1());

                        host.Close();
        }
  • 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-22T15:03:27+00:00Added an answer on May 22, 2026 at 3:03 pm

    Put the [KnownTypes] attribute to let WCF to know what concrete classes implements your interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to get comfortable with multi tier applications (Server / Client Architecture).
Please let me know what architecture do VoIP applications use, P2P or Client-Server? Thank
We are having a client-server architecture where client goes offline when connects remotely to
it's a kind of client-server architecture problem. I have 2 projects in my solution:
I am currently writing an application having a client server architecture. The client is
In continuation to my question How to improve the performance of client server architecture
I am developing an application in C# WPF which will have Client-Server architecture (Client
i have application with client-server architecture. client (C program): generate various DER encoded data
Scenario I've written a distributed application in C# using WCF. It uses Client/Server architecture,
I've a server/client architecture implemented, where all state changes are sent to the function,

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.