日期:2014-05-17  浏览次数:20436 次

wcf两个连接问题
app.config中配置是这样的 
XML code
<system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="NoneSecurity" useDefaultWebProxy="false">
          <security mode="None"/>
        </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="CHINAZTT.ZTAM.BLL.ZTAMBehavior"
        name="CHINAZTT.ZTAM.BLL.User">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="NoneSecurity"
          contract="CHINAZTT.ZTAM.BLL.IUser" ><!--listenUriMode="Unique"-->
          <identity>
            <!--http://localhost:8731/User/mex-->
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8731/User" />
          </baseAddresses>
        </host>
      </service>
      <service
        behaviorConfiguration="CHINAZTT.ZTAM.BLL.ZTAMBehavior"
        name="CHINAZTT.ZTAM.BLL.REP.Report">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="NoneSecurity"
                  contract="CHINAZTT.ZTAM.BLL.REP.IReport" ><!--listenUriMode="Unique"-->
          <!--http://localhost:8732/Report/mex-->
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Report" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="CHINAZTT.ZTAM.BLL.ZTAMBehavior">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        <behavior name="">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

<!--把listenUriMode="Unique"写在里面就会报错-->
“/”应用程序中的服务器错误。

远程主机强迫关闭了一个现有的连接。

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.Net.Sockets.SocketException: 远程主机强迫关闭了一个现有的连接。

源错误: 


行 72:         
行 73:         public System.Collections.Generic.List<CHINAZTT.ZTAM.MODEL.Resource> QueryChild() {
行 74:             return base.Channel.QueryChild();
行 75:         }
行 76:         

源文件: C:\Users\QiuJiaLong\Desktop\CHINAZTT.ZTAM\CHINAZTT.ZTAM.UI.MVC\Service References\ReportBLL\Reference.cs    行: 74 


不写这个wcf服务器就启动不了,怎么办?
 

------解决方案--------------------
<!--把listenUriMode="Unique"写在里面就会报错-->
 你是要干什么啊呢,webconfig 不支持这样的节点啊,还要向啊,或者你节点放做地反了
------解决方案--------------------
你确定不是同步导致的错误?