繁体   English   中英

在Web应用程序中添加WCF引用在配置中找不到端点?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM