1

我正在尝试在 WAS 和 IIS 中为 http 和 net.tcp 托管我的 WCF 4 Web 服务。是否可以删除 net.tcp 绑定的 .svc 扩展名?

如果我执行以下操作,我会收到错误

在 net.tcp://myserver.com/service/TestService 上没有可以接受消息的端点监听。这通常是由不正确的地址或 SOAP 操作引起的。有关更多详细信息,请参阅 InnerException(如果存在)。

 <system.serviceModel>
      <serviceHostingEnvironment multipleSiteBindingsEnabled="true">
          <serviceActivations>
              <add relativeAddress="TestService.svc" service="Web.TestService"/>
          </serviceActivations>   
      </serviceHostingEnvironment>     




      <services>
          <service name="Web.TestService" behaviorConfiguration="WebService">
              <host>
                  <baseAddresses>
                      <add baseAddress="http://myserver.com/service/" />

                  </baseAddresses>

              </host>
              <endpoint address=""  contract="Web.ITestService" binding="basicHttpBinding"></endpoint>
              <endpoint address="net.tcp://myserver.com:808/service/TestService" contract="Web.ITestService" binding="netTcpBinding"></endpoint>
              <endpoint address="net.tcp://myserver.com:808/service/TestService/mex"  binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange"></endpoint>
          </service>
      </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WebService">                       
          <serviceMetadata httpGetEnabled="true"/>            
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>   
  </system.serviceModel>
4

1 回答 1

0

Nazaf 这些行会导致错误,因为您的地址不正确,您有两个协议。

baseAddress="http://myserver.com/service/"
+
<endpoint address="net.tcp://myserver.com:808/service/TestService" contract="Web.ITestService" binding="netTcpBinding"></endpoint>

您的地址中有两个协议,删除基本地址并设置不同的值

您可以阅读这篇关于解决它非常有趣的文章:http: //msdn.microsoft.com/en-us/magazine/cc163412.aspx

于 2012-08-25T20:39:17.287 回答