【发布时间】:2015-04-02 13:12:42
【问题描述】:
我在单独的项目名称中创建了一个WCF 服务 AaWs 然后将此项目添加到网站项目中作为参考。网站项目名称是AaNuWs
在网站项目web.config文件中是
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="mexBehavior">
<serviceMetadata httpGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="mexBehavior" name="AaWs.RxtraIntroService">
<endpoint address ="AaWs" binding="basicHttpBinding" contract="AaWs.IRxIntro">
</endpoint>
<host>
<baseAddresses>
<add baseAddress = "http://localhost:8080" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
然后将此网站项目上传到我的网络服务器上。
然后在我的网站上的新项目中提供服务参考,并带有名称空间
介绍服务
http://mywebsite/IntroService.svc?wsdl
新系统为我创建一个新的 app.config 文件
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IRxIntro" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://mywebsite/IntroService.svc/RecoverInfoTechAaWs"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRxIntro"
contract="IntroService.IRxIntro" name="BasicHttpBinding_IRxIntro" />
</client>
</system.serviceModel>
</configuration>
但现在当我尝试访问此服务时出现错误。
System.InvalidOperationException:找不到默认端点 引用合同“IntroService.IRxIntro”的元素 ServiceModel 客户端配置部分。这可能是因为没有 为您的应用程序找到了配置文件,或者因为没有 可以在客户端中找到与此合同匹配的端点元素 元素。
请帮帮我
【问题讨论】:
标签: c# .net web-services wcf service