Facebook
From Sludgy Zebra, 6 Years ago, written in Plain Text.
This paste is a reply to Untitled from Sloppy Owl - go back
Embed
Viewing differences between Untitled and Re: Untitled
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Text;
using System.Threading.Tasks;
using WCFServiceClient.ServiceReference1;
using WCFServiceContract;

namespace WCFServiceClient
WCFServiceHost
{
    class Program
    {
        static void Main(string[] args)
        {http://pastebin.pl/
            KalkulatorLZClient client 
{
            Uri baseAddress2 
= new KalkulatorLZClient();
            KalkulatorLZClient client2 
Uri("http://localhost:11112/DunnoWhat");
            String baseAddress3 = "net.tcp://localhost:11113/SerwisTCP";
            ServiceHost host 
= new KalkulatorLZClient("basicHttpBinding");
            KalkulatorLZClient client3 
ServiceHost(typeof(MojKalkulatorLZ));

            //ServiceEndpoint endpoint1 = host.Description.Endpoints.Find(typeof(IKalkulatorLZ));
            ServiceEndpoint endpoint2 = host.AddServiceEndpoint(typeof(IKalkulatorLZ), new WSHttpBinding(), baseAddress2);
            ServiceEndpoint endpoint3 = host.AddServiceEndpoint(typeof(IKalkulatorLZ), new NetTcpBinding(), baseAddress3);

            ServiceMetadataBehavior smb 
= new KalkulatorLZClient("mexHttpBinding");

            client.Open();

            LiczbaZ lru1 
ServiceMetadataBehavior();
            smb.HttpGetEnabled 
new LiczbaZ(3, 4);
            LiczbaZ lru2 = new LiczbaZ(5, 6);
true;
            host.Description.Behaviors.Add(smb);

            host.Open();
            Console.WriteLine("Klient1:");
WriteLine("Host uruchomiony.");
            Console.WriteLine("...Dodaj LZ (3,4) i (5,6)");
            LiczbaZ result2 = client.DodajLZ(lru1, lru2);
WriteLine("Aby zakonczyc nacisnij ");
            Console.WriteLine("...(3, 4) + (5, 6) = ({0}, {1})", result2.czescR, result2.czescU);
            client.Close();
ReadLine();
            host.Close();

        }
    }
}