gpt4 book ai didi

.net - 具有 basicHttpBinding 和 netTcpBinding 的 WCF 服务;无法访问 HTTP 端点

转载 作者:行者123 更新时间:2023-12-05 00:52:25 26 4
gpt4 key购买 nike

我想使用 netTcpBinding 和 basicHttpBinding 提供相同的接口(interface)。我还想为两个端点提供 wsdl。当我访问 http://localhost:9876/TestService/ ,我在 http://localhost:9876/TestService/?wsdl 处获得了包含 Tcp 端点信息的 mex 端点, 但地址 http://localhost:9876/TestService/ws没有回应,我不明白为什么。我有基地址和相对地址。有人可以帮我指出缺少的东西吗?现在,我只是在尝试使用 TestImplementation 服务,而我还没有搞乱 MessaginImplementation 服务。

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="SimpleBinding" />
</basicHttpBinding>
<netTcpBinding>
<binding name="DefaultTCPBinding" transactionFlow="true" />
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MetadataBehavior">
<serviceMetadata httpGetEnabled="true" httpGetBinding="webHttpBinding"
httpGetBindingConfiguration="" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="MetadataBehavior" name="CompanyX.AppServer.Implementation.TestImplementation">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="DefaultTCPBinding"
name="TestTCPEndpoint" contract="CompanyX.AppServer.Interfaces.ITest" />
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
name="TestMex" contract="IMetadataExchange" />
<endpoint address="/ws" binding="basicHttpBinding" bindingConfiguration="SimpleBinding"
name="Test" contract="CompanyX.AppServer.Interfaces.ITest" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9878/TestService" />
<add baseAddress="http://localhost:9876/TestService/" />
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="MetadataBehavior" name="CompanyX.AppServer.Implementation.MessaginImplementation">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="DefaultTCPBinding"
name="MessagingTCPEndpoint" contract="CompanyX.AppServer.Interfaces.IMessaging" />
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
name="MessagingMex" contract="CompanyX.AppServer.Interfaces.IMessaging" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9878/MessagingService" />
<add baseAddress="http://localhost:9876/MessagingService" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>

最佳答案

这是我的菜鸟错误。它实际上是正确的。答案在the post below .
当我点击基本 HTTP 类时,我只得到浏览器的响应,但是使用这个 wsdl,我可以连接两个绑定(bind)。

关于.net - 具有 basicHttpBinding 和 netTcpBinding 的 WCF 服务;无法访问 HTTP 端点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4412278/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com