我对我的 SOAP 服务(wcf)有疑问 我实现了我的 wcf 服务,并且所有函数在编译时都正确实现 我没有任何编译时错误,但是当我运行代码时,我收到了此错误消息
An endpoint configuration section for contract 'test.ICore' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration
我认为在 SOAP 服务中我们需要对 web.config 文件进行一些更改 另一点是我的项目有多个 SOAP 服务。 这会引起问题吗?
我该如何解决这个问题? 非常感谢您
最佳答案
我认为您的问题是因为您的 web.config 文件中有多个具有相同地址的端点 像这样
<binding name="TestSoap">
<security mode="Transport" />
</binding>
<binding name="TestSoap" />
<endpoint address="http://TestSoap/Core.svc/soap"
binding="basicHttpBinding" bindingConfiguration="Soap" contract="TestSoap.ICore"
name="TestSoap" />
<endpoint address="https://TestSoap/Core.svc/soap"
binding="basicHttpBinding" bindingConfiguration="TestSoap"
contract="TestSoap.ICore" name="TestSoap" />
您可以将此示例用于您的代码。
希望能解决你的问题
关于wcf - 找到该合约的多个端点配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74275694/