1

I have a WCF service that I need to expose using NetNamedPipeBinding in WCF. Due to certain restrictions, I am not able to self host as a windows service. It MUST go through IIS.

I feel I have exhausted all available resources to try to get my service up and running, but I am not able to consume it, or even tell if its being picked up by IIS.

NOTE- I made sure the Net Pipe Listener Service was on and the "Non Activation" stuff was turned on which is covered in the articles below. Additionally, I changed the "Enabled Protocols" in my IIS site to "http,net.pipe".

I am trying to consume the service with the following code:

string baseAddress = "net.pipe://localhost/Services/";
ChannelFactory<IMyService> factory = new ChannelFactory<IMyService>(  
                                   new NetNamedPipeBinding(NetNamedPipeSecurityMode.None),
                                   baseAddress);

IMyService service = factory.CreateChannel();
var restResult = service.MyMethod();

My web.config has the following service definition.

<system.serviceModel>
  <services>
    <service name="Path.To.My.Service.MyService"
           behaviorConfiguration="NamedPipeServiceBehavior">
      <host>
        <baseAddresses>
          <add baseAddress="net.pipe://localhost/Services/"/>
        </baseAddresses>
      </host>
      <endpoint address=""
                binding="netNamedPipeBinding"
                contract="Path.To.My.Service.IMyService"/>
      <endpoint address="mex"
                binding="mexNamedPipeBinding"
                contract="IMetadataExchange"/>
    </service>
  </services>
  <bindings>
    <netNamedPipeBinding>
      <binding name="Binding1">
        <security mode="None"/>
      </binding>
    </netNamedPipeBinding>
  </bindings>
  <behaviors>
    <serviceBehaviors>
      <behavior name="NamedPipeServiceBehavior">
        <serviceMetadata />
        <serviceDebug includeExceptionDetailInFaults="false"/>
      </behavior>
    </serviceBehaviors>
  </behaviors>
  <serviceHostingEnvironment multipleSiteBindingsEnabled="True" aspNetCompatibilityEnabled="True"/>
 </system.serviceModel>

I wish I had a very straightforward question, but really I am not quite sure where the issue is.

I am not sure if IIS is picking this service up, I am fairly positive that the metadata is not being exposed correctly.

I have referenced the following articles/examples:

http://dotnetmentors.com/wcf-by-example-on-netnamedpipebinding.aspx http://dotnetmentors.com/hosting-wcf-service-with-nettcpbinding-or-netnamedpipebinding-in-iis.aspx http://mohammedatef.wordpress.com/tag/netnamedpipebinding/ http://msdn.microsoft.com/en-us/library/ms752247.aspx http://tech.pro/tutorial/855/wcf-tutorial-basic-interprocess-communication

TheJediCowboy
  • 8,924
  • 28
  • 136
  • 208

1 Answers1

0

You need to set up binding for IIS site.

Pavel
  • 524
  • 4
  • 8