Web services WCF测试客户端无法添加服务-无法获取元数据

Web services WCF测试客户端无法添加服务-无法获取元数据,web-services,wcf,testing,client,metadata,Web Services,Wcf,Testing,Client,Metadata,我看到关于这个问题有很多问题。我花了一天半的时间尝试了所有不同的建议。到目前为止,还没有一个对我有效,我不知道下一步该怎么办。因此,我希望有人能看到这个问题并帮助我解决这个问题。几年前,有一段时间,几台电脑前,我让这些都为我工作。但当我不得不换一台新的电脑时,我当时或以后的任何时候都无法让它工作,但我能够解决它。现在我需要为当前任务解决此问题 我在本地计算机上的IIS(不是IIS Express)中运行SOAP WCF Web服务 我创建了一个应用程序池。基本设置是带有集成管道模式的.NET F

我看到关于这个问题有很多问题。我花了一天半的时间尝试了所有不同的建议。到目前为止,还没有一个对我有效,我不知道下一步该怎么办。因此,我希望有人能看到这个问题并帮助我解决这个问题。几年前,有一段时间,几台电脑前,我让这些都为我工作。但当我不得不换一台新的电脑时,我当时或以后的任何时候都无法让它工作,但我能够解决它。现在我需要为当前任务解决此问题

我在本地计算机上的IIS(不是IIS Express)中运行SOAP WCF Web服务

我创建了一个应用程序池。基本设置是带有集成管道模式的.NET Framework v4.0.30319。高级设置将标识设置为ApplicationPoolIdentity

我创建了一个网站(不使用默认网站。)

定义了两个绑定:

我们有一个客户和一个服务自签名证书,用于开发和QA。我已将服务证书分配给https绑定。webservice通过net.tcp与另一个wcf服务通信

在基本设置中,我定义了c:\inetpub\websitename的物理路径。为了成功连接,使用测试设置…,我必须以特定用户身份连接,使用我的网络域用户名和密码。我还没有找到解决这个问题的办法

在高级设置中。。。。应用程序池设置为我创建的应用程序池。物理路径为c:\inetpub\wwwroot\websitename。启用的协议设置为http,net.tcp

我能够成功浏览到该网站

以下是web服务的web.config:

  <system.serviceModel>
<client>
  <endpoint address="net.tcp://10.100.13.28:8102/Acord/201307" behaviorConfiguration="NetTcpCertificatesBehavior" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" contract="AcordContract.IAcordService201307" name="AcordEndpoint">
    <identity>
      <certificateReference findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" isChainIncluded="false" storeLocation="LocalMachine" x509FindType="FindByThumbprint" />
      <!--<dns value="localhost" />-->
    </identity>
  </endpoint>
  <endpoint address="net.tcp://qaschedapp:8002/IMS/201210" behaviorConfiguration="NetTcpCertificatesBehavior" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" contract="IdentityManagementContract.IIdentityManagementService201210" name="IMSEndpoint">
    <identity>
      <certificateReference findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" isChainIncluded="false" storeLocation="LocalMachine" x509FindType="FindByThumbprint" />
    </identity>
  </endpoint>
</client>
<services>
  <service name="AcordWebService.AcordWebService" behaviorConfiguration="Visible">

    <endpoint address="" binding="basicHttpsBinding" contract="AcordWebService.IAcordWebService201307" bindingConfiguration="BasicHttpsBinding">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="https://10.100.13.28:51448/" />
      </baseAddresses>
    </host>
    <!--binding for clients outside the firewall calling from C# with WCF using certs -->
    <endpoint address="net.tcp://10.100.13.28:8122/AcordWebService.svc" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" name="NetTcpCertificatesEndpoint" contract="AcordWSContract.IAcordWSService201309">
      <identity>
        <dns value="localhost"/>
      </identity>
    </endpoint>
  </service>
</services>
<behaviors>
  <endpointBehaviors>
    <behavior name="NetTcpCertificatesBehavior">
      <clientCredentials>
        <clientCertificate findValue="631f5a67a9a70bc78540bb809e73fd1dbd00bbeb" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" />
        <serviceCertificate>
          <authentication certificateValidationMode="None" />
        </serviceCertificate>
      </clientCredentials>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="Visible">
      <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" httpGetUrl=""/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="true"/>
      <serviceCredentials>
        <serviceCertificate findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/>
        <clientCertificate>
          <certificate findValue="631f5a67a9a70bc78540bb809e73fd1dbd00bbeb" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/>
        </clientCertificate>
      </serviceCredentials>
    </behavior>   
  </serviceBehaviors>
</behaviors>
<bindings>
  <basicHttpsBinding>
    <!--binding for clients within the firewall but calling the old style soap service-->
    <binding name="BasicHttpsBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <security mode="Transport">
        <transport clientCredentialType="None" />
      </security>
    </binding>
  </basicHttpsBinding>
  <netTcpBinding>
    <binding name="NetTcpCertificatesBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <!--<readerQuotas maxDepth="32" maxStringContentLength="65535" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />-->
      <!--<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />-->
      <security>
        <transport clientCredentialType="Certificate" protectionLevel="EncryptAndSign" />
      </security>
    </binding>
  </netTcpBinding>
</bindings>
<protocolMapping>
  <add binding="wsHttpBinding" scheme="https" />
</protocolMapping>    
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />

如果这是您可以访问的Windows(R)通信基础服务,请检查您是否已在指定地址启用元数据发布。有关启用元数据发布的帮助,请参阅Exchange错误URI处的MSDN文档:元数据包含无法解析的引用:“”。无法为具有权限“10.100.13.28:51448”的SSL/TLS安全通道建立信任关系。基础连接已关闭:无法为SSL/TLS安全通道建立信任关系。根据验证过程,远程证书无效。HTTP GET Error URI:下载“”时出错。基础连接已关闭:无法为SSL/TLS安全通道建立信任关系。根据验证过程,远程证书无效

最后,要填补信息中的几个漏洞:

如果我能最终解决这个问题,我将非常感谢所有的帮助


提前感谢。

以下是我解决问题的方法:

首先,我必须打开web.config中的日志记录:

  <system.serviceModel>
    <diagnostics>
      <messageLogging maxMessagesToLog="30000" logEntireMessage="true"
              logMessagesAtServiceLevel="true"
              logMalformedMessages="true"
              logMessagesAtTransportLevel="true"
              maxSizeOfMessageToLog="65535000">
      </messageLogging>
    </diagnostics>
  </system.serviceModel>
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel"
              switchValue="Verbose, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="traceListener" />
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add name="traceListener"
           type="System.Diagnostics.XmlWriterTraceListener"
           initializeData="c:\logs\Traces.svclog" />
    </sharedListeners>    
    <trace autoflush="true" />
  </system.diagnostics>

除了我授予IIS AppPool用户权限之外。这解决了我的问题