2013-10-08 191 views
0

我想使用WCF测试客户端来测试我的WCF服务,这里是我的app.config。这很好,但是当我将baseAddress更改为“net.pipe:// localhost/VSWCFPipe”时,它不再起作用。将baseAddress更改为命名管道的正确方法是什么?我只想使用net.pipe,因为这仅适用于本地计算机上的IPC。在VB.net命名管道问题的WCF

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.serviceModel> 
    <services> 
     <service behaviorConfiguration="WCFServiceBehavior" 
     name="WCFEngineService.WCFService"> 
     <clear /> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" 
      listenUriMode="Explicit"> 
      <identity> 
      <dns value="localhost" /> 
      <certificateReference storeName="My" storeLocation="LocalMachine" 
       x509FindType="FindBySubjectDistinguishedName" /> 
      </identity> 
     </endpoint> 
     <endpoint address="net.pipe://localhost/VSWCFPipe" binding="netNamedPipeBinding" 
      bindingConfiguration="" contract="WCFEngineService.IWCF" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:8888/WCFEngineService/Service" /> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="WCFServiceBehavior"> 
      <serviceMetadata httpGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="False"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
</configuration> 

回答

0

按我的理解,你错过添加net.pipe协议中已启用的协议列表。请通过以下步骤并确认设置是否正确。

  1. 转到IIS(在运行窗口中输入INETMGR
  2. 从左边窗格中的服务的选择并点击右键。
  3. 从右键上下文菜单中选择管理应用程序---->高级设置菜单。
  4. 在高级设置窗口中选择启用协议属性。
  5. 默认情况下会添加http协议。用逗号分隔符添加net.pipe。例如:http,net.pipe
+0

嗨,谢谢你的帮忙!我启动了IIS,但该服务未显示在左侧窗格中。另外,我需要net.tcp吗?我试图只使用命名管道。谢谢。 –

+0

@DannyBoy对不起,这是一个错字。你需要提到net.pipe而不是net.tcp。请参阅下面的链接以了解如何在IIS中托管WCF服务http://msdn.microsoft.com/en-us/library/ms733766.aspx –