关于WCF在IIS配置问题
1 我在Services跟目录下新建Service.svc文件 内容:<%@ ServiceHost Service="Service.Services"%>
2 在Services跟目录下新建Web.Config 内容:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="metadataBehavior">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="metadataBehavior" name="Service.Services">
<endpoint address="http://127.0.0.1:100/sample" binding="wsHttpBinding" contract="Contract.IService" />
</service>
</services>
</system.serviceModel>
</configuration>
3 客户端App.config 内容
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<client>
<endpoint address="http://127.0.0.1/WcfService/Service.svc" binding="wsHttpBinding" contract="Contract.IService" name="shows" />
<!--<endpoint address="http://127.0.0.1:90/sample" binding="wsHttpBinding" contract="Contract.IService" name="shows" />-->
</client>
</system.serviceModel>
</configuration>
生成解决方案后 到地址栏输入 http://127.0.0.1/WcfService/Service.svc
报错:
--------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- 服务器端去掉
address="http://127.0.0.1:100/sample"
试一试。 --------------------编程问答-------------------- address使用address=""试一试 --------------------编程问答-------------------- 不是要添加监控节点的么?好 试试 --------------------编程问答-------------------- 这又是为何?不要地址? 我先试试
补充:.NET技术 , ASP.NET