C# IIS 7.0中的WCF服务主机
我有一个WCF,当我在本地主机上运行它时,它已成功运行。但是,当针对特定的域地址(www.esimsol.com)运行它时,我会遇到一个问题。任何人都可以帮助我如何为(“http://www.esimsol.com/evalservicesite/eval.svc"). 我的本地主机配置文件是:C# IIS 7.0中的WCF服务主机,c#,wcf,C#,Wcf,我有一个WCF,当我在本地主机上运行它时,它已成功运行。但是,当针对特定的域地址(www.esimsol.com)运行它时,我会遇到一个问题。任何人都可以帮助我如何为(“http://www.esimsol.com/evalservicesite/eval.svc"). 我的本地主机配置文件是: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <comp
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service behaviorConfiguration="EvalServiceLibrary.Service1Behavior"
name="EvalServiceLibrary.EvalService">
<endpoint address="" binding="wsHttpBinding" contract="EvalServiceLibrary.IEvalService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8081/EvalServiceLibrary/EvalService/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="EvalServiceLibrary.Service1Behavior">
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="True"/>
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
注意:特别是基址您必须使用名称将解决方案发布到iis服务器。 发布后,请尝试使用以下地址运行您的服务:http://www.esimsol.com/evalservicesite/eval.svc 并将您的基本地址更改为
将LoaclHost服务器8081发布到任何服务器后,您都不能使用它,它应该是本地主机或您的网站名
<identity>
<dns value="localhost" />
</identity>
&
将基址替换为www.esimsol.com我再次在IIS中托管我的服务。但是,当我尝试调用我的服务时,我得到了以下消息:没有一个端点可以在侦听时接受该消息。这通常是由不正确的地址或SOAP操作引起的。请参阅内部异常(如果存在),有关详细信息,请参见。dude您必须以此名称在IIS中承载/发布此网站。此网站已成功发布,则只有此地址才是有效地址。发布成功,但我收到了相同的消息。dude您还必须提供您的客户端终结点。我无法在上述配置中找到您的客户端终结点。这是主要原因。
<host>
<baseAddresses>
<add baseAddress="http://localhost:8081/EvalServiceLibrary/EvalService/" />
</baseAddresses>
</host>