当前位置: 代码迷 >> Web Service >> WCF增添服务失败。服务元数据可能无法访问。请确保服务正在运行并且正在公开元数据
  详细解决方案

WCF增添服务失败。服务元数据可能无法访问。请确保服务正在运行并且正在公开元数据

热度:386   发布时间:2016-05-02 02:45:29.0
WCF添加服务失败。服务元数据可能无法访问。请确保服务正在运行并且正在公开元数据。
错误: 无法从 http://localhost:8732/mex 获取元数据如果是您有权访问的 Windows (R) Communication Foundation 服务,请检查是否已启用在指定地址发布元数据。有关启用元数据发布的帮助,请参阅 http://go.microsoft.com/fwlink/?LinkId=65455 上的 MSDN 文档。WS-Metadata Exchange 错误    URI: http://localhost:8732/mex    元数据包含无法解析的引用:“http://localhost:8732/mex”。    <?xml version="1.0" encoding="utf-16"?><Fault xmlns="http://www.w3.org/2003/05/soap-envelope"><Code><Value>Receiver</Value><Subcode><Value xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</Value></Subcode></Code><Reason><Text xml:lang="zh-CN">由于内部错误,服务器无法处理该请求。有关该错误的详细信息,请打开服务器上的 IncludeExceptionDetailInFaults (从 ServiceBehaviorAttribute 或从 &lt;serviceDebug&gt; 配置行为)以便将异常信息发送回客户端,或在打开每个 Microsoft .NET Framework 3.0 SDK 文档的跟踪的同时检查服务器跟踪日志。</Text></Reason></Fault>HTTP GET Error    URI: http://localhost:8732/mex    下载“http://localhost:8732/mex”时出错。    请求因 HTTP 状态 400 失败: Bad Request。




在线等。。。。
------最佳解决方案--------------------
     up。。。。。。。
------其他解决方案--------------------
如果你深信你的地址没有问题,那么需要检查下你OperationContract的返回值/参数是否是可序列化的。


------其他解决方案--------------------
需要暴露 MEX
在web.config中加入

<serviceBehaviors>
  <behavior name = "MetadataBehavior">
    <serviceMetadata />
  </behavior>
</serviceBehaviors>

和mex endpoint
<endpoint binding="mexHttpBinding" bindingConfiguration=""
                    contract="IMetadataExchange" />


参考
http://bloggingabout.net/blogs/dennis/archive/2006/11/09/WCF-Part-4-_3A00_-Make-your-service-visible-through-metadata.aspx
------其他解决方案--------------------
在客户端需要代理
------其他解决方案--------------------
主机 服务 没有起来吧, 地址设置好了没?
------其他解决方案--------------------
主机服务起了 地址没问题
------其他解决方案--------------------
先装IIS再装.NETFRAMEWORK
ASPNET_REGIIS -T
重新启动IIS
------其他解决方案--------------------
http://localhost:8732/[ServiceName]/mex

你服务基地址是啥啊?没有ServiceName吗?
------其他解决方案--------------------
学习学习!
------其他解决方案--------------------
关注一下
------其他解决方案--------------------
 自己顶下。。
------其他解决方案--------------------
倒粪贴,按规定处理
------其他解决方案--------------------
学习中
------其他解决方案--------------------
把接口方法名字换一个,试试
------其他解决方案--------------------
谢谢!
------其他解决方案--------------------
  相关解决方案