Skip to content

Signalgo server HelloWorld

Ali Yousefi edited this page Nov 14, 2018 · 1 revision

After install packages from Installations and Requirements

Just make a console application in your visual studio:

using SignalGo.Server.ServiceManager;
using SignalGo.Shared.DataTypes;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SignalgoTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //create instance of your provider
            ServerProvider serverProvider = new ServerProvider();
            //register your service class
            serverProvider.RegisterServerService<HelloWorldService>();
            //start your server service
            serverProvider.Start("http://localhost:6428/SignalGo");

            //open url in your browser
            Process.Start("http://localhost:6428/HelloWorld/HelloSignalGo?name=yourName");
            Console.WriteLine("server started now call");
            Console.ReadKey();
        }
    }

    [ServiceContract("HelloWorld", ServiceType.HttpService, InstanceType.SingleInstance)]
    public class HelloWorldService
    {
        public string HelloSignalGo(string name)
        {
            return "Hello " + name;
        }
    }
}