2012-05-28 75 views
2

由於某些原因,我無法獲取我的服務的Net.Pipe端點(EP)工作。WCF返回錯誤「沒有端點在net.pipe ....上偵聽」

這是一個在IIS7中託管的.Net 4.0 WCF服務。

有兩種故障...

  • 首先在EP將不提供元數據。
  • 其次,EP不會真正起作用 - 我正在通過VS2010的WCF測試客戶端進行測試。

我認爲兩者實際上都是同一個問題。

實際收到的錯誤是...

There was no endpoint listening at net.pipe://[machinename].[domainname]/Services/TestService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

我注意到的第一件事是,無論什麼我打電話給我管道在基本解決了它被重新命名爲[計算機]。[域名]這看起來很奇怪。這在輸出的服務元數據中很明顯。但是,如果我在測試客戶端中使用我的管道名稱或這個重命名的名稱,那麼這兩者都不起作用。

我還啓用了Windows功能中的WAS,爲IIS中的所有協議設置站點綁定,並在IIS(http,net.tcp,net)中的「啓用協議」框中鍵入協議名稱。管)。我還檢查了「Net.Pipe偵聽器適配器」是否在Windows Servics中啓動。

我的http和net.tcp EP的工作正常,並返回元數據。

我的配置如下 - 有誰知道什麼可以阻止這個EP工作?我很確定它的簡單!

<system.serviceModel> 
    <behaviors> 
     <!-- EP Behaviors --> 
     <endpointBehaviors> 
     <behavior name="PayloadMessageInspector"> 
      <MessageHeaderBehavior /> 
      <MessagePayloadBehavior /> 
     </behavior> 
     </endpointBehaviors> 
     <!-- Service Behaviors --> 
     <serviceBehaviors> 
     <behavior name="GenericServiceBehavior"> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
      <serviceMetadata httpGetEnabled="true" policyVersion="Policy15" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <!-- Bindings Section --> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    <bindings> 
     <!-- Basic Http Binding --> 
     <basicHttpBinding> 
     <binding maxReceivedMessageSize="10485760" maxBufferSize="10485760" maxBufferPoolSize="10485760"> 
      <security mode="TransportCredentialOnly"> 
      <transport clientCredentialType="Windows" /> 
      </security> 
     </binding> 
     </basicHttpBinding> 
     <!-- Net TCP Binding --> 
     <netTcpBinding> 
     <binding maxReceivedMessageSize="10485760" maxBufferSize="10485760" maxBufferPoolSize="10485760" />   
     </netTcpBinding> 
     <!-- Net Pipe Binding --> 
     <netNamedPipeBinding> 
     <binding maxReceivedMessageSize="10485760" maxBufferSize="10485760" maxBufferPoolSize="10485760" /> 
     </netNamedPipeBinding>  
    </bindings> 
    <!-- Services Section --> 
    <services>  
     <!-- Membership Service --> 
     <service name="TestService" behaviorConfiguration="GenericServiceBehavior"> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost/Services/TestService.svc" /> 
      <add baseAddress="net.tcp://localhost/Services/TestService.svc"/> 
      <add baseAddress="net.pipe://Dev/Services/TestService.svc"/> 
      </baseAddresses> 
     </host> 
     <!-- HTTP --> 
     <endpoint 
      address="" 
      binding="basicHttpBinding" 
      contract="ITestService" name="TestServiceBasicHttp" behaviorConfiguration="PayloadMessageInspector" /> 
     <!-- NetTCP --> 
     <endpoint 
      address="" 
      binding="netTcpBinding" 
      contract="ITestService" name="TestServiceNetTcp" behaviorConfiguration="PayloadMessageInspector" /> 
     <!-- NetPipe --> 
     <endpoint 
      address="" 
      binding="netNamedPipeBinding" 
      contract="ITestService" name="TestServiceNetPipe" behaviorConfiguration="PayloadMessageInspector" /> 
     <!-- Mex (Net.Tcp/Net.Pipe) --> 
     <endpoint name="TestServiceNetTcpMex" address="mex" binding="mexTcpBinding" contract="IMetadataExchange" /> 
     <endpoint name="TestServiceNetPipeMex" address="mex" binding="mexNamedPipeBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 
    <!-- Extensions --> 
    <extensions> 
     <behaviorExtensions> 
     <add name="MessageHeaderBehavior" type="ServiceMessageHeaderBehavior, TestService.Logging" /> 
     <add name="MessagePayloadBehavior" type="ServiceMessagePayloadBehavior, TestService.Logging" /> 
     </behaviorExtensions> 
    </extensions> 
    </system.serviceModel> 

回答

1

WCF測試客戶端能看到我的命名管道終點後,我增加了以下MEX終結:

通過觀察測試客戶端生成的配置,我發現我讓我的客戶的端點地址錯誤。這結束了我的工作...

net.pipe://localhost/{webapproot}/{path}/ServiceName.svc/{relativeaddress} 

我希望這可以幫助某人。

相關問題