同一端口号中的两个WCF服务显示错误 [英] Two WCF services in same port number shows error
问题描述
我正在相同的端口号上创建两个WCF Windows服务,其显示在net.tcp://localhost:9000/RockLogDataAccessService上没有侦听端点可以接受该消息.这通常是由于地址不正确或SOAP操作.有关详细信息,请参阅InnerException(如果存在)."此错误.
服务器端的app.config文件如下:
< 客户端 > ;
< 端点 =" net.tcp://localhost:9000/ComperAppService" span>
span> 绑定 netTcpBinding"
span> 合同 ComperAppServiceReference.IComperAppService"
span> 名称 NetTcpBinding_IComperAppService" >
< 身份 >
< dns =" localhost" / < /identity >
< /endpoint >
< 端点 =" net.tcp://localhost:9000/ComperDataAccessService" span>
span> 绑定 netTcpBinding"
合同 ComperDataAccessServiceReference.IComperDataAccessService"
名称 NetTcpBinding_IComperDataAccessService" < 身份 >
< dns =" localhost" / < /identity >
< /endpoint >
< /Client > 我从错误中意识到,您向net.tcp://localhost:9000/RockLogDataAccessService
地址发送了一条消息,但您仅在net.tcp://localhost:9000/ComperAppService
处定义了端点和net.tcp://localhost:9000/ComperDataAccessService
地址...
I am creating two WCF windows services in same port number, its shows "There was no endpoint listening at net.tcp://localhost:9000/RockLogDataAccessService that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details." this error.
Server side app.config file given below:
<client>
<endpoint address="net.tcp://localhost:9000/ComperAppService"
binding="netTcpBinding"
contract="ComperAppServiceReference.IComperAppService"
name="NetTcpBinding_IComperAppService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="net.tcp://localhost:9000/ComperDataAccessService"
binding="netTcpBinding"
contract="ComperDataAccessServiceReference.IComperDataAccessService"
name="NetTcpBinding_IComperDataAccessService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</Client>
解决方案 As I realized from the error, you sent a message to the net.tcp://localhost:9000/RockLogDataAccessService
address but, you defined endpoints only at the net.tcp://localhost:9000/ComperAppService
and the net.tcp://localhost:9000/ComperDataAccessService
addresses...
这篇关于同一端口号中的两个WCF服务显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!