我已经在IIS上部署了我的wcf服务。当我要访问其方法“找不到端点”时,它给了我这个错误,而在本地对我来说工作正常并返回了数据。
这是我的Web.config绑定信息
<system.webServer>
<directoryBrowse enabled="false" />
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service name="RTAService" behaviorConfiguration="WtfServiceBehaviour">
<endpoint address="" binding="webHttpBinding" bindingConfiguration="wtfSslBinding" behaviorConfiguration="WebHttpBehaviour" contract="IRTAService" />
<endpoint address="soap" binding="basicHttpBinding" contract="IRTAService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="wtfSslBinding" />
<binding name="streamedBinding"
maxBufferSize="65536"
maxReceivedMessageSize="2000000000"
transferMode="Streamed">
<readerQuotas maxDepth="500000000"
maxArrayLength="500000000" maxBytesPerRead="500000000"
maxNameTableCharCount="500000000" maxStringContentLength="500000000"/>
<security mode="None" />
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="WebHttpBehaviour">
<webHttp helpEnabled="true" defaultBodyStyle="Wrapped" defaultOutgoingResponseFormat="Json"
automaticFormatSelectionEnabled="false" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="WtfServiceBehaviour">
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
请告诉我任何解决方法。
最佳答案
我看不到端点定义任何地方。您的配置应该有这样的内容。
<endpoint address="http://localhost:57800/Services.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IServices" contract="MYServices.IServices"
name="BasicHttpBinding_IServices" />
关于c# - 找不到WCF服务端点,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11253211/