Exemplo n.º 1
0
    public static ChannelFactory <ICallbackService <TMessage, TResponse> > GetChannelFactory <TMessage, TResponse>(string server)
    {
        BasicHttpBinding myBinding  = new BasicHttpBinding();
        string           address    = AddressBuilder.GetAddress <TMessage, TResponse>(server);
        EndpointAddress  myEndpoint = new EndpointAddress(address);

        return(new ChannelFactory <ICallbackService <TMessage, TResponse> >(myBinding, myEndpoint));
    }
Exemplo n.º 2
0
    public void StartListening <TMessage, TResponse>()
    {
        var host     = new ServiceHost(new CallbackService <TMessage, TResponse>(bus));
        var binding  = new BasicHttpBinding();
        var address  = AddressBuilder.GetAddress <TMessage, TResponse>(server);
        var contract = typeof(ICallbackService <TMessage, TResponse>);

        host.AddServiceEndpoint(contract, binding, address);
        host.Open();
        serviceHosts.Add(host);
    }
Exemplo n.º 3
0
    public void StartListening <TMessage, TResponse>()
    {
        ServiceHost      host     = new ServiceHost(new CallbackService <TMessage, TResponse>(endpointInstance));
        BasicHttpBinding binding  = new BasicHttpBinding();
        string           address  = AddressBuilder.GetAddress <TMessage, TResponse>(server);
        Type             contract = typeof(ICallbackService <TMessage, TResponse>);

        host.AddServiceEndpoint(contract, binding, address);
        host.Open();
        serviceHosts.Add(host);
    }