YeahTrivia: Creating a Trivia Server/Client with WPF and WCF

Sign in to queue

The Discussion

  • User profile image
    Gasper's Tech Corner

    If you want a good sample of building applications with WPF & WCF give this a shot: https://blogs.msdn.com/coding4fun/archive/2007/10/29/5773166.asp...

  • User profile image
    jbmixed

    cool, but the download links are broken!

  • User profile image
    Clint

    @jbmixed:  On it.

  • User profile image
    Clint

    @jbmixed: link fixed.  Thanks for the heads up.

  • User profile image
    Clint

    Thanks Nuno!

  • User profile image
    Nuno

    Found a workaround:

    In the client code:

    SyncContext = SynchronizationContext.Current;

                   InstanceContext instanceContext = new InstanceContext(this);

                   ServiceProxyInstance = new ServiceProxy(instanceContext);

    I added these lines:

                   WSDualHttpBinding binding = (WSDualHttpBinding)ServiceProxyInstance.Endpoint.Binding;

                   string clientCallbackAddress = binding.ClientBaseAddress.AbsoluteUri;

                   clientCallbackAddress += Guid.NewGuid().ToString();

                   binding.ClientBaseAddress = new Uri(clientCallbackAddress);

    And now it works!

    What do you think?

    Best regards,

    Nuno

  • User profile image
    Nuno

    If i try to run 2 clients in the same machine (and the server, naturally), the second client cannot register itsel, and i receive a framework error. Wasn't it supposed to work with as many clients as wished?

    Thanks in advance!

  • User profile image
    Michael

    Use of .vdproj file seems to keep source from opening with VS Express 2008. Any thoughts?

  • User profile image
    Johny79

    How can I get this project to run on another machine and have the server on another? I am getting an error that says:

    "Inconceivable! An error has occurred. The caller was not authenticated by the service"

    Help! I have a similar project like your and am running into issues.

    Thanks.

  • User profile image
    Clint

    @Johny79, contacting the author for advise on this.

  • User profile image
    Clint

    @Johny79:  This is the response I got:

    The project can run across multiple machines, as I tested this before publishing; judging from his comment he appears to have the same issue with a different project as well.  There are quite a few permissions/IIS/WCF security issues that may need to be checked within his environment to allow WCF communication to work.  if you receive more detail on issue we can think on it. I'd start with making sure a basic web service can be hosted and viewed from another machine, and then run Fiddler to determine if any errors are blocking communication.  I would also make sure the port number used is not being blocked along the way.

  • User profile image
    ksuvalk

    Just came across this nice walk-thru and was wondering if anyone has "converted" this to Silverlight on the client side.  Just now learning it so not sure if it's a direct WPF port or not.  Thx!

Add Your 2 Cents