none
WCF : Issues in adding a new netNamedPipeBinding endpoint RRS feed

  • Question

  • I have an IIS hosted web service (

    http://localhost/Directory.Server/Services/v2/Directory.svc/ws

    ) that works with wsHttpBinding. It is consumed by a WebApp. I need an additional endpoint for the same service with named pipe so that I can access the service from another project running on the same machine.

    I made the changes in web.config to expose the namedpipe endpoint. But, even before I test the new namedpipe endpoint, the existing wsHttpBinding endpoint started throwing error with this change.

    Error from the consuming WebApp - The requested service, '' could not be activated. See the server's diagnostic trace logs for more information.

    There is no doubt that the addition of namedpipe endpoint is causing the issue. If I fix the namedpipe issue, both endpoints will work.

    Here are my web.config changes -

    Here are my web.config changes -

      <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttp" maxBufferPoolSize="524288" maxReceivedMessageSize="10485760" messageEncoding="Mtom">
          <readerQuotas maxDepth="0" maxStringContentLength="0" maxArrayLength="0" maxBytesPerRead="0" maxNameTableCharCount="0" />
          <security mode="None">
            <transport clientCredentialType="None" />
            <message clientCredentialType="None" />
          </security>
        </binding>
      </wsHttpBinding>
      <netNamedPipeBinding>
        <binding name="Binding10" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="10485760">
          <security mode="Transport">
            <transport protectionLevel="EncryptAndSign"/>
          </security>
        </binding>
      </netNamedPipeBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Default_Directory">
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="Default_Directory" name="Directory.Server.Services.v2.Directory">
        <endpoint address="ws" binding="wsHttpBinding" bindingConfiguration="wsHttp" name="wsHttp_Directory" contract="Directory.Server.Services.v2.IDirectory" />
        <endpoint address="mex" binding="mexHttpBinding" name="mex_Directory" contract="IMetadataExchange" />
        <endpoint address="net.pipe://localhost/Directory.Server/Services/v2/Directory.svc/np" binding="netNamedPipeBinding" bindingConfiguration="Binding10" name="namedPipe_Directory" contract="Directory.Server.Services.v2.IDirectory" />
      </service>
    </services>
    Wednesday, July 17, 2013 9:45 PM

Answers

All replies

  • I have an IIS (IIS 8 running on Windows 8) hosted web service (

    http://localhost/Directory.Server/Services/v2/Directory.svc/ws

    ) that works with wsHttpBinding. It is consumed by a WebApp. I need an additional endpoint for the same service with named pipe so that I can access the service from another project running on the same machine.

    I made the changes in web.config to expose the namedpipe endpoint. But, even before I test the new namedpipe endpoint, the existing wsHttpBinding endpoint started throwing error with this change.

    Error from the consuming WebApp - The requested service, '' could not be activated. See the server's diagnostic trace logs for more information.

    There is no doubt that the addition of namedpipe endpoint is causing the issue. If I fix the namedpipe issue, both endpoints will work.

    Here are my web.config changes -

    Here are my web.config changes -

      <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttp" maxBufferPoolSize="524288" maxReceivedMessageSize="10485760" messageEncoding="Mtom">
          <readerQuotas maxDepth="0" maxStringContentLength="0" maxArrayLength="0" maxBytesPerRead="0" maxNameTableCharCount="0" />
          <security mode="None">
            <transport clientCredentialType="None" />
            <message clientCredentialType="None" />
          </security>
        </binding>
      </wsHttpBinding>
      <netNamedPipeBinding>
        <binding name="Binding10" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="10485760">
          <security mode="Transport">
            <transport protectionLevel="EncryptAndSign"/>
          </security>
        </binding>
      </netNamedPipeBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Default_Directory">
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="Default_Directory" name="Directory.Server.Services.v2.Directory">
        <endpoint address="ws" binding="wsHttpBinding" bindingConfiguration="wsHttp" name="wsHttp_Directory" contract="Directory.Server.Services.v2.IDirectory" />
        <endpoint address="mex" binding="mexHttpBinding" name="mex_Directory" contract="IMetadataExchange" />
        <endpoint address="net.pipe://localhost/Directory.Server/Services/v2/Directory.svc/np" binding="netNamedPipeBinding" bindingConfiguration="Binding10" name="namedPipe_Directory" contract="Directory.Server.Services.v2.IDirectory" />
      </service>
    </services>

    • Edited by T_Andy Wednesday, July 17, 2013 9:32 PM
    • Merged by Amanda Zhu Tuesday, July 23, 2013 2:18 AM the same issue
    Wednesday, July 17, 2013 9:31 PM
  • There is no doubt that the addition of namedpipe endpoint is causing the issue. If I fix the namedpipe issue, both endpoints will work.

    Hi T_Andy,

    I'm trying to help you.

    From the words I quoted ,Does it mean that this issue is about the endpoint.

    Posting this issue to the forum of  WCF  you will get more helps.

    Best regards.


    IE show the page

    Thursday, July 18, 2013 7:03 AM
  • Hi,

    If we host our wcf services in IIS, by default the address will be http:// or https://. But for the NetNamePipedBinding the address will be net.pipe://....

    So in order to get NetNamePipedBinding to work on IIS, you must enable Windows Process Activation Service (WAS) on IIS and configure the site that you are using to allow named pipes.

    For more information, please try to refer to: 

    #NamedPipe Activation:
    http://msdn.microsoft.com/en-us/library/ms752253.aspx .

    #How to WCF service with netNamedPipeBinding in IIS:
    http://dotnetmentors.com/hosting-wcf-service-with-nettcpbinding-or-netnamedpipebinding-in-iis.aspx .

    Hope it can help you.

    Best Regards.


    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.






    • Marked as answer by T_Andy Friday, July 19, 2013 4:19 PM
    Thursday, July 18, 2013 9:48 AM
    Moderator
  • Both HTTP and net.pipe endpoints are working now. In fact, WAS was already enabled but I didn't enable the binding and protocol in the site and app level in IIS.

    %windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.pipe',bindingInformation='*']

    %windir%\system32\inetsrv\appcmd.exe set app "Default Web Site/app name" /enabledProtocols:http,net.pipe 

     

    Friday, July 19, 2013 4:26 PM