Поделиться через


Using Indigo to communicate with Windows Forms applications, Part I

Indigo provides a standards-based, interoperable mechanism for exchanging messages in a peer-to-peer manner.  With that in mind, you may find yourself wanting to use Indigo as the communication mechanism with your Windows Form applications, as it means your application is reachable by anything that talks SOAP.

Consider this Window Form that implements the IFooService interface and exposes itself as a service endpoint:

     public partial class Form1 : Form, IFooService
    {
        private ServiceHost<Form1> _fooService;

        public Form1()
        {
            InitializeComponent();

            _fooService = new ServiceHost<Form1>(this);
            _fooService.Open();
        }

        #region IFooService Members

        public void Bar(string text)
        {
            this.textBox1.Text = text;
        }

        #endregion
    }

All that’s left is to configure the binding for the endpoint and this Windows Form application is reachable from anything that talks SOAP.

Comments

  • Anonymous
    July 08, 2005
    In Part I and Part II of this series, I showed how to implement a service within a Form and how to use...