2013-10-08 107 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 –