【发布时间】:2020-08-06 16:21:00
【问题描述】:
经过 3 天的永无止境的搜索,我发布了这个。请帮忙。以下是我拥有的配置文件。只指定了一个端点,但它说端点存在冲突。请帮我纠正这个冲突。
System.InvalidOperationException:绑定实例已经 关联到监听 URI 'http://dd.myserver.net/MyWebService/MyService'。如果两个端点想要 要共享相同的 ListenUri,它们还必须共享相同的绑定 对象实例。指定了两个冲突的端点 在 AddServiceEndpoint() 调用中、在配置文件中或以下组合中 AddServiceEndpoint() 和配置。
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/>
<add key="wcf:webservicehost:enableautomaticendpointscompatability" value="true"/>
</appSettings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
<authentication mode="None"/>
<customErrors mode="Off"/>
</system.web>
<system.serviceModel>
<services>
<service behaviorConfiguration="ServiceBehavior" name="MyRESTService.MyService">
<endpoint address="" behaviorConfiguration="web" binding="webHttpBinding" contract="MyRESTService.IMyService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647"/>
<security mode="None">
</security>
</binding>
</webHttpBinding>
</bindings>
<protocolMapping>
<add binding="webHttpBinding" scheme="http"/>
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="false"/>
</system.webServer>
</configuration>
【问题讨论】: