WCF 在VS中,添加服务引用,地址输入http://ip/Service.svc,点击前往,提示错误,内容如下:
WCF的service端的webconfig如下:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<services>
<service behaviorConfiguration="ServiceBehavior"
name="WcfServiceLibrary1.Service1">
<endpoint binding="wsHttpBinding"
bindingConfiguration=""
contract="WcfServiceLibrary1.IService1"/>
</service>
</services>
</system.serviceModel>
</configuration>
WCF 在VS中,添加服务引用,地址输入http://ip/Service.svc,点击前往,提示错误,内容如下:
下载“http://127.0.0.1:7293/WCFServerRefWCFLib.svc”时出错。
请求因 HTTP 状态 404 失败: Not Found。
元数据包含无法解析的引用:“http://127.0.0.1:7293/WCFServerRefWCFLib.svc”。
没有终结点在侦听可以接受消息的 http://127.0.0.1:7293/WCFServerRefWCFLib.svc。这通常是由于不正确的地址或者 SOAP 操作导致的。如果存在此情况,请参见 InnerException 以了解详细信息。
远程服务器返回错误: (404) 未找到。
如果该服务已在当前解决方案中定义,请尝试生成该解决方案,然后再次添加服务引用。
解决方法是:
在<system.serviceModel>节点中添加:
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
最后的配置是:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<services>
<service behaviorConfiguration="ServiceBehavior"
name="WcfServiceLibrary1.Service1">
<endpoint binding="wsHttpBinding"
bindingConfiguration=""
contract="WcfServiceLibrary1.IService1"/>
</service>
</services>
</system.serviceModel>
</configuration>
WCF 在VS中,添加服务引用,地址输入http://ip/Service.svc,点击前往,提示错误,内容如下:的更多相关文章
- 添加web引用和添加服务引用有什么区别?
添加web引用和添加服务引用有什么区别,Add Service References 和 Add Web References 有啥区别?参考 http://social.microsoft.com/ ...
- (转)添加服务引用和添加Web引用对比
在WindowsForm程序中添加服务引用和Web引用对比 为了验证书上有关Visual Studio 2010添加服务引用和Web引用的区别,进行实验. 一.建立一个Web服务程序项目新建项目,选择 ...
- 添加服务引用和添加Web引用对比
原文:添加服务引用和添加Web引用对比 在WindowsForm程序中添加服务引用和Web引用对比 为了验证书上有关Visual Studio 2010添加服务引用和Web引用的区别,进行实验. 一. ...
- .net 添加web引用和添加服务引用有什么区别?
添加web引用和添加服务引用有什么区别, Add Service References 和 Add Web References 有啥区别? 参考 http://social.microsoft.co ...
- WebService-.Net:添加web引用和添加服务引用有什么区别?
ylbtech-WebService-.Net:添加web引用和添加服务引用有什么区别? 1.返回顶部 1. 添加web引用和添加服务引用有什么区别,Add Service References 和 ...
- WCF无.SVC文件服务激活,及不添加服务引用调用WCF
一,新建WCF服务引用程序 1,删除.svc文件,全部删除. 2,新建 IService 类 namespace TestWcf { [ServiceContract] public interfac ...
- [问题]通过IIS宿主发布WCF服务,客户端添加服务引用出错的解决办法
环境配置:Web服务器:Windows Server 2008,iis7.5,.net4.0客户端:XPsp3 vs2010 sp1 问题描述:1.确定WCF服务访问地址 http://servic ...
- WCF 添加服务引用 HTTP 请求已超过为 00:00:00 分配的超时。为此操作分配的时间可能是较长超时
今天在用公司的笔记本引用WCF的时候,处于一直等待的过程,一直在下载信息,一直等了很长时间,弹出了一个消息 下载“http://ip:8085/xxxxx/xxxxx/mex/$metadata”时出 ...
- WCF分布式开发常见错误解决(1):An error occurred while attempting to find services at...添加服务引用出错
WCF分布式开发常见错误解决(1):An error occurred while attempting to find services at...添加服务引用出错 当我们在客户端添 ...
随机推荐
- dreamweaver中用正则表达式查找替换批量删除 tppabs标签的方法
查找替换 正则表达式 \btppabs="h[^"]*" 后面不能有空格 你懂得的 选中右下角的 √[使用正则表达式] 替换全部
- 安装和启动mongodb数据库
参考链接:http://www.fkblog.org/blog569 参考链接:http://www.cnblogs.com/linjiqin/p/3192159.html
- Sql Server Profiler跟踪死锁
Sql Server Profiler一个很重要的应用场景就是监视分析死锁. 下面通过一个例子来学习Profiler是如何监视死锁的. 1. 创建测试数据模拟死锁, 创建表Table_A和Table_ ...
- 了解下SoftReference
昨天同事看到别人一段关于实现缓存功能的代码,看完之后他有点不明觉厉,哈哈,然后就给周围同事也看了下,可能之前大家都没用过SoftReference,所以并不明白是如何实现的. 于是我就把代码要了过来, ...
- AjaxFileUpload 在C#中应用
一.前台页面 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head ru ...
- axure注册码
ahjesus Axure RP 7.0注册码 用户名:axureuser 序列号:8wFfIX7a8hHq6yAy6T8zCz5R0NBKeVxo9IKu+kgKh79FL6IyPD6lK7G6+t ...
- linux gcc 和 g++ 编译
gcc编译 gcc -o test.out test.c g++ 编译 g++ -o test.out test.cpp
- centos mail 不能发邮件
http://alfred-long.iteye.com/blog/1836488 (参考) 最近centos 6.4突然不能发邮件了, 直接用 mail命令测试也不收不到邮件 以下参考大侠们的经验后 ...
- (转)jquery ajax使用及跨域访问解决办法
原文地址:***/UIweb/jquery_ajax_kuayujiejue.html 最近开发中,设计到智能手机项目,给领导做几个demo.主要是用jquery和jqeury mobile. 越来越 ...
- style、currentStyle、getComputedStyle区别介绍
style.currentStyle.getComputedStyle区别介绍 来自:蓝色天空 样式表有三种方式 内嵌样式(inline Style) :是写在Tag里面的,内嵌样式只对所有的Tag有 ...