Esempio n. 1
0
 static void TestService(string xmlFilename, string xsdFilename)
 {
     ConfigurationHost.Install (xmlFilename, xsdFilename);
     var client = new MyService.MyServiceClient ();
     var hello = client.Hello ();
     Console.WriteLine ("Got response from service: {0}", hello);
 }
Esempio n. 2
0
        static void TestService()
        {
            DownloadFromMyMac ("config.xml");
            DownloadFromMyMac ("config.xsd");

            C.ConfigurationHost.Install ("config.xml", "config.xsd");
            WebRequest.DefaultWebProxy = new WebProxy ("http://192.168.16.104:3128");
            var client = new MyService.MyServiceClient ();
            var hello = client.Hello ();
            Console.WriteLine ("Got response from service: {0}", hello);
        }
Esempio n. 3
0
        static void TestClient()
        {
            var netTcp = new NetTcpBinding (SecurityMode.TransportWithMessageCredential, false);
            netTcp.TransferMode = TransferMode.Streamed;
            netTcp.Security.Transport.ClientCredentialType = TcpClientCredentialType.None;

            // var binding = new CustomBinding ();
            // binding.Elements.Add (new TextMessageEncodingBindingElement ());
            // binding.Elements.Add (new TcpTransportBindingElement ());

            var address = new EndpointAddress ("net.tcp://provcon-faust:8888/MyService/");
            var client = new MyService.MyServiceClient (netTcp, address);
            var serviceAuth = client.ClientCredentials.ServiceCertificate.Authentication;
            serviceAuth.CertificateValidationMode = X509CertificateValidationMode.PeerOrChainTrust;
            serviceAuth.TrustedStoreLocation = StoreLocation.LocalMachine;
            var hello = client.Hello ();
            Console.WriteLine ("Got response from service: {0}", hello);
        }