簡體   English   中英

沒有端點監聽net.pipe異常

[英]No endpoint listening at net.pipe exception

我有很多WCF服務,我需要從另一個服務中調用一個服務。 netNamedPipeBinding ,我決定使用netNamedPipeBinding

我的web.config文件看起來像這樣。 (我沒有在這里復制不相關的東西。)

 <services>
          <service             name="Services.AuthorizationService"    >
            <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" >
            <endpoint
              name="AuthorizationService"
              address=""
              binding="basicHttpBinding"               contract="ServiceContracts.IAuthorizationService" />
            <endpoint address="net.pipe://localhost/TestSite/AuthorizationService.svc"
                   binding="netNamedPipeBinding"                   contract="ServiceContracts.IAuthorizationService"
                   name="AuthorizationNamedPipeEndpoint"/>           
          </service>
</Services>

web.config文件中的客戶端部分如下所示:

<client>
      <endpoint address="net.pipe://localhost/TestSite/AuthorizationService.svc"
       binding="netNamedPipeBinding"            contract="ServiceContracts.IAuthorizationService" name="AuthorizationServiceNamedPipe" />
    </client>

我試圖像這樣調用OperationContract之一(GetDetails):

  using (ChannelFactory<IAuthorizationService> authorizationChannel = new ChannelFactory<IAuthorizationService>("AuthorizationServiceNamedPipe"))
                        {
                            IAuthorizationService authorizationService = authorizationChannel.CreateChannel();
                            var response = authorizationService.GetDetails(new GetDetailsRequestMessage());
                        }

當我執行此代碼時,我在調用OperationContract GetDetails的行中得到異常:

在net.pipe://localhost/TestSite/AuthorizationService.svc上沒有可以接受該消息的端點。 這通常是由錯誤的地址或SOAP操作引起的。 有關更多詳細信息,請參閱InnerException(如果存在)。

我無法找出確切的問題。 也沒有InnerException。 我使用的是Windows7機器,IIS版本是IIS7.5。 請注意,我可以從我的Winform應用程序中調用此服務,沒有任何問題。 net.pipe綁定添加到IIS中的網站綁定。

如何使用net.pipe傳輸確保服務正常工作? 在HTTP的情況下,我們可以在IE中瀏覽並確保它。

Control Panel —> Programs and Features, and then click "Turn Windows Components On or Off" in the left pane. Expand the Microsoft .NET Framework 3.5激活Windows Communication Foundation Non-HTTP Activation組件后,此問題已解決Control Panel —> Programs and Features, and then click "Turn Windows Components On or Off" in the left pane. Expand the Microsoft .NET Framework 3.5 Control Panel —> Programs and Features, and then click "Turn Windows Components On or Off" in the left pane. Expand the Microsoft .NET Framework 3.5

當它被激活並且您使用非HTTP綁定時,將自動使用WAS。

我做了一個非常基本和愚蠢的錯誤,但它幫助我學到了很多東西。 以下文章對我幫助很大:

使用WAS擴展超出HTTP的WCF服務

在Windows激活服務中托管WCF服務

當消費者嘗試調用虛擬機上托管的WCF服務調用時,WCF會拒絕訪問

最后一個鏈接給了我一個指針,服務器證書相關的配置可能會導致麻煩。 我正在為服務添加一個行為(在問題中沒有看到)。 該行為使用的是服務器證書。

我們在SharePoint 2013中遇到了同樣的問題。安裝期間發生了一些事情,並且未啟用激活設置。 我不確定它是否是應用程序服務器功能或其他問題。

謝謝你的帖子! 我們也能夠糾正SP 2013問題。 以下是我們看到的那些可能遇到它的人的例外情況:

System.ServiceModel.EndpointNotFoundException:net.pipe://localhost/SecurityTokenServiceApplication/appsts.svc上沒有可以接受該消息的端點 這通常是由錯誤的地址或SOAP操作引起的。 有關更多詳細信息,請參閱InnerException(如果存在)。 --->

System.IO.PipeException:在本地計算機上找不到管道端點'net.pipe://localhost/SecurityTokenServiceApplication/appsts.svc'。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM