communicatoin and sending object between 2 wpf App

Simon Ong 21 Reputation points
2021-02-09T14:54:04.867+00:00

I am reading quite a lot on WCF (Duplex Service) but i am still scratching my head how to implement it in my wpf applications. Below is the basic idea i am working on.

There will be 2 Application. WPF A and WPF B.

1) A send a message to B for status

2) if Idle, Send an object (either a List<Object> or ObservanleCollection<object> to B

3) WPF will Start work and block any more request base on the object received

4) Once task completed, WPF B will message A the last Status.

How can i implement it with WCF ?

65845-wcf.jpg

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,922 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,784 questions
{count} votes

Accepted answer
  1. Duane Arnold 3,211 Reputation points
    2021-02-10T15:01:33.97+00:00

    The 2 equipment are Industrial Logic Controller with Ethernet/IP connectivity whereas the other measuring output from a machine which is running custom RS232 protocol.

    So you need a UI like WPF for both programs?


4 additional answers

Sort by: Most helpful
  1. Simon Ong 21 Reputation points
    2021-02-10T01:50:10.533+00:00

    3) Why can't MSMQ be used with WCF and let the service process the request out of the queue?

      Is it possible to show me more details ?  Hopefully you can provide the right spark for me to understand how it work?
    

    Note: The service process must have a UI to let user to start /stop/pause the equipment. FYI, it consist multiple serial and ethernet communication link up with the Application "live".

    4) Why must A receive a message from B that it's done?

      The main reason is all the equipment can only process a request one at the time and it run sequentially. So a new request can only be process once the existing request is done. 
    

    Thanks

    Simon

    0 comments No comments

  2. Duane Arnold 3,211 Reputation points
    2021-02-10T06:30:00.133+00:00

    The main reason is all the equipment can only process a request one at the time and it run sequentially. So a new request can only be process once the existing request is done.

    A flag can be set to block code execution on the client or server side code to block code execution until the current processing has completed.

    https://www.c-sharpcorner.com/UploadFile/17e8f6/msmq-in-wcf/

    It could be a selfhosting WCF service using MSMQ and/or a database, an exe, instead of a Windows service hosting a WCF service.

    I don't consider a WPF solution to be a backend solution.

    https://www.codemag.com/Article/0701041/Hosting-WCF-Services

    I consider WPF to be client-side a front-end solution consisting of UI(s). I consider WCF service using a database or MSMQ as a backend solution in client/server with both sides being scalable in their own rights, which can be two tier solution running on the same computer.

    https://learn.microsoft.com/en-us/previous-versions/msp-n-p/ee658117(v=pandp.10)

    0 comments No comments

  3. Duane Arnold 3,211 Reputation points
    2021-02-10T06:34:09.413+00:00

    One of your responses was about holding onto raw data or something.

    My response to that is that is the purpose of a database to hold onto data.


  4. Duane Arnold 3,211 Reputation points
    2021-02-10T12:24:15.087+00:00

    What is B's job work with what equipment? Are these two programs running on the same computer?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.