我在以下位置有一个服务文件。
C:\Documents and Settings\U16990\My Documents\Visual Studio 2010\Projects\CalculationService\CalculationService\CalculationService.svc
当我浏览 svc 文件时,它工作正常。服务端点如下所列。它目前是用于地址的相对地址。
<service name="CalculationService.CalculationService" behaviorConfiguration="MyServiceTypeBehaviors">
<endpoint address="CalculationService" behaviorConfiguration=""
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_CalculationServiceInterface"
contract="ICalculationService" />
</service>
我机器的IP地址是10.10.179.180 //InterNetwork AddressFamily
当我将地址更改为使用绝对路径时,它会引发错误:
<services>
<service name="CalculationService.CalculationService" behaviorConfiguration="MyServiceTypeBehaviors">
<endpoint
address="http://10.10.179.180/C:/Documents and Settings/U16990/My Documents/Visual Studio 2010/Projects/CalculationService/CalculationService/CalculationService.svc/CalculationService"
behaviorConfiguration=""
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_CalculationServiceInterface"
contract="ICalculationService" />
</service>
</services>
错误:: 没有协议绑定与给定地址“ http://10.10.179.180/C:/Documents and Settings/U16990/My Documents/Visual Studio 2010/Projects/CalculationService/CalculationService/CalculationService.svc/CalculationService”匹配。协议绑定在 IIS 或 WAS 配置中的站点级别进行配置。说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
我们能做些什么来纠正它?
注意:我正在使用Visual Studio 2010测试该服务。
参考: