Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

Configure WCF service hosted in WAS in code

$
0
0

How should this error being understanding? What is wrong?

The protocol 'net.pipe' is not supported.

Is it possible to configure a WCF service in the code behind instead in the web.config.?

the code is:

 public static void Configure(ServiceConfiguration config)

        {

            ExeConfigurationFileMap cfMap;

            cfMap = new ExeConfigurationFileMap() { ExeConfigFilename = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "web.config") };

            var cf = ConfigurationManager.OpenMappedExeConfiguration(cfMap, ConfigurationUserLevel.None);

            config.LoadFromConfiguration(cf);

            config.EnableProtocol(new NetNamedPipeBinding(NetNamedPipeSecurityMode.None));

            Binding wsBinding = new WSHttpBinding();

            Binding npBinding = new NetNamedPipeBinding();

            config.AddServiceEndpoint(typeof(IBTPPSvc), wsBinding, "http://localhost/SomeDirectory/Service1");

            config.AddServiceEndpoint(typeof(IBTPPSvc), npBinding, "net.pipe://localhost/SomeDirectory/Service1");

}


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>