[英]Adding WCF reference to web app can't find endpoint in config?
更新:我從另一個Web服務器獲得了完全相同的配置。 有什么想法對它為什么起作用但對另一種不起作用?
我有一個MVC Web應用程序,我試圖向其中添加WCF服務引用。 WCF服務位於Web服務器上,我可以在瀏覽器(您創建了服務)的默認頁面中拉出該服務。 VS for WCF中的測試客戶端也可以使用該服務。 嘗試添加引用時出現以下錯誤...
沒有端點可以接受該消息。 這通常是由不正確的地址或SOAP操作引起的。
這是我的服務配置模型...
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Basic" sendTimeout="12:00:00" receiveTimeout="12:00:00" openTimeout="00:10:00" closeTimeout="00:10:00"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" messageEncoding="Mtom">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="TSRBehavior" name="TechnologyServiceRequestWCF.TSRWebService">
<endpoint address="~/TSRWebService.svc"
binding="basicHttpBinding"
bindingConfiguration="Basic"
name="Basic"
contract="TechnologyServiceRequestWCF.ITSRWebService" />
<endpoint address="mex"
binding="mexHttpBinding"
name="Metadata"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="TSRBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceTimeouts transactionTimeout="24:00:00"/>
<serviceThrottling maxConcurrentCalls="100" maxConcurrentInstances="100" maxConcurrentSessions="100"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
尚無客戶端配置,因為參考成功與服務對話后會自動為您生成該配置。
嘗試刪除mex端點並更改行
includeExceptionDetailInFaults =“ true”由serviceDebug includeExceptionDetailInFaults =“ false”
對於那些尋找最適合大多數人的簡單配置的人來說,我的配置沒有錯! 我的問題最終成為繞過防火牆的移植問題。 所以我這沒錯。 :)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.