当前位置:编程学习 > C#/ASP.NET >>

WCF 获取元数据如果是您有权访问的 Windows (R) Communication Foundation 服务,请检查是否已启用在指定地址发布元数据。

错误: 无法从 net.tcp://its.hongqilin.cn:4504/ITS.WCFService.RecordService.svc/mex 获取元数据如果是您有权访问的 Windows (R) Communication Foundation 服务,请检查是否已启用在指定地址发布元数据。有关启用元数据发布的帮助,请参阅 http://go.microsoft.com/fwlink/?LinkId=65455 上的 MSDN 文档。WS-Metadata Exchange 错误    URI: net.tcp://its.hongqilin.cn:4504/ITS.WCFService.RecordService.svc/mex    元数据包含无法解析的引用:“net.tcp://its.hongqilin.cn:4504/ITS.WCFService.RecordService.svc/mex”。    无法连接到 net.tcp://its.hongqilin.cn:4504/ITS.WCFService.RecordService.svc/mex。连接尝试持续了 00:00:21.0052014 时间跨度。TCP 错误代码 10060: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。 220.194.56.123:4504。    由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。 220.194.56.123:4504


下边贴上我的wcf配置文件

<configuration>
  <configSections>
    <sectionGroup name="spring">
      <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
      <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
      <!--<section name="parsers" type="Spring.Context.Support.NamespaceParsersSectionHandler,Spring.Core"/>-->
    </sectionGroup>
  </configSections>
  <spring>
    <!--<parsers>
      <parser type="Spring.Data.Config.DatabaseNamespaceParser,Spring.Data"/>
    </parsers>-->
    <context>
      <resource uri="assembly://ITS.ExternalLibs/ITS.ExternalLibs.SpingConfigs/CommonDao.xml"/>
      <resource uri="assembly://ITS.ExternalLibs/ITS.ExternalLibs.SpingConfigs/DataAccessObjects.xml"/>
      <resource uri="assembly://ITS.ExternalLibs/ITS.ExternalLibs.SpingConfigs/Business.xml"/>
      <resource uri="assembly://ITS.ExternalLibs/ITS.ExternalLibs.SpingConfigs/WCFService.xml"/>
    </context>
  </spring>
  <system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" >
      <!--<baseAddressPrefixFilters>
        <add prefix="net.tcp://its.wcf.hongqilin.cn:4504"/>
      </baseAddressPrefixFilters>-->
    </serviceHostingEnvironment>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ITS.WCFService.RecordServiceBehavior">
          <serviceMetadata/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="ITS.WCFService.RecordServiceBehavior" name="ITS.WCFService.RecordService">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration="ServerBinding" contract="ITS.WCFService.IRecordService"/>
        <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:4504/RecordService"/>
          </baseAddresses>
        </host>
      </service>
    </services>
    <bindings>
      <netTcpBinding>
        <binding name="ServerBinding"
                 closeTimeout="00:01:00"
                 openTimeout="00:01:00"
                 receiveTimeout="00:10:00"
                 sendTimeout="00:10:00"
                 transactionFlow="false"
                 transferMode="Buffered"
                 transactionProtocol="OleTransactions"
                 hostNameComparisonMode="StrongWildcard"
                 listenBacklog="10"
                 maxBufferPoolSize="2147483647"
                 maxBufferSize="2147483647"
                 maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
          <security mode="None">
            <transport  clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
            <message clientCredentialType="None" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>



这是全部的配置文件
http://its.hongqilin.cn/ITS.WCFService.RecordService.svc
这个是访问路径,求解决方案,在wcf测试客户端添加这个服务会以上错误。 --------------------编程问答-------------------- 周末是很冷清啊,一个人没有,我已经解决上边的问题了,是因为端口的net.tcp监听服务没有打开

现在是silverlight4 录音怎么把文件保存为MP3格式呢? --------------------编程问答-------------------- 今天调用wcf 出了新的问题 
未能调用服务。可能的原因: 服务已脱机或无法访问;客户端配置与代理不匹配;现有的代理无效。有关详细信息,请参阅堆栈跟踪。可以尝试通过启动新的代理、还原到默认配置或刷新服务来恢复。

不存在主机 win-oig3se6tqta 的 DNS 项。

Server stack trace: 
   在 System.ServiceModel.Channels.DnsCache.Resolve(Uri uri)
   在 System.ServiceModel.Channels.SocketConnectionInitiator.GetIPAddresses(Uri uri)
   在 System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
   在 System.ServiceModel.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
   在 System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
   在 System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
   在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   在 System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   在 System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
   在 System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
   在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   在 IRecordService.GetData(Int32 value)
   在 RecordServiceClient.GetData(Int32 value)

Inner Exception:
不知道这样的主机。
   在 System.Net.Dns.GetAddrInfo(String name)
   在 System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   在 System.Net.Dns.GetHostEntry(String hostNameOrAddress)
   在 System.ServiceModel.Channels.DnsCache.Resolve(Uri uri)

以上是错误的详细信息。
补充:.NET技术 ,  Web Services
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,