WCF 唯一基地址问题
我遇到 WCF 报告的问题...
net.pipe://192.168.0.100/SystemA/Service1.svc/mexPipe' 无法激活。
我已将我的基地址定义如下:
服务 1...
<baseAddresses>
<add baseAddress="http://192.168.0.100:8050/ProductsService/Service1.svc" />
<add baseAddress="net.tcp://192.168.0.100:8051/ProductsService/Service1.svc" />
<add baseAddress="net.pipe://192.168.0.100/ProductsService/Service1.svc" />
</baseAddresses>
服务 2...
<baseAddresses>
<add baseAddress="http://192.168.0.100:8050/ProductsService/Service2.svc" />
<add baseAddress="net.tcp://192.168.0.100:8051/ProductsService/Service2.svc" />
<add baseAddress="net.pipe://192.168.0.100/ProductsService/Service2.svc" />
</baseAddresses>
对于每个服务,我按如下方式定义 Mex 端点...
<endpoint address="mexPipe" contract="IMetadataExchange" binding="mexNamedPipeBinding" />
这肯定会给我 2x mex 端点,如下所示。 ..
net.pipe://192.168.0.100/ProductsService/Service1.svc/mexPipe
net.pipe://192.168.0.100/ProductsService/Service2.svc/mexPipe
但是,我认为看这篇文章这不起作用...
发帖者似乎与我有类似的配置,响应者指出每个方案中的基地址都不是“唯一的” - 但它们肯定是,因为它们都引用了两个唯一的服务?
WCF 能否检测到我的 mex 端点是 netNamedPipe 并查找它们的基地址?鉴于绑定是“mexNamedPipeBinding” - 或者这不起作用?
I have a problem where WCF is reporting...
net.pipe://192.168.0.100/SystemA/Service1.svc/mexPipe' could not be activated.
I have defined my base addresses as follows:
Service 1...
<baseAddresses>
<add baseAddress="http://192.168.0.100:8050/ProductsService/Service1.svc" />
<add baseAddress="net.tcp://192.168.0.100:8051/ProductsService/Service1.svc" />
<add baseAddress="net.pipe://192.168.0.100/ProductsService/Service1.svc" />
</baseAddresses>
Service 2...
<baseAddresses>
<add baseAddress="http://192.168.0.100:8050/ProductsService/Service2.svc" />
<add baseAddress="net.tcp://192.168.0.100:8051/ProductsService/Service2.svc" />
<add baseAddress="net.pipe://192.168.0.100/ProductsService/Service2.svc" />
</baseAddresses>
For each service I then define Mex endpoints as follows...
<endpoint address="mexPipe" contract="IMetadataExchange" binding="mexNamedPipeBinding" />
This should surely give me 2x mex endpoints as follows...
net.pipe://192.168.0.100/ProductsService/Service1.svc/mexPipe
net.pipe://192.168.0.100/ProductsService/Service2.svc/mexPipe
However I dont think that this is working looking at this post...
net.tcp binding metadata problem
The poster appears to have a similar configuration to me and the responder states that the base addresses are not "unique" within each scheme - but surely they are as they both reference two unique services?
Can WCF detect that my mex end points are netNamedPipe and look up the base address for them? Given that the binding is "mexNamedPipeBinding" - or doesnt this work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的基址不应包含服务文件名。您将在端点声明中指定这一点。
如您所见,您的要点是:
这肯定是不正确的,因为服务文件中没有 mex 端点的文件夹。
相反,将您的基地址定义为:
将端点定义为:
您会发现您的 mex 端点变为:
看起来不错。
Your base addresses aren't supposed to include the service file name. You'll specify that in the endpoint declaration.
As you can see, your enpoints are:
Which most certainly can't be correct as the service file doesn't have a folder in it for the mex endpoint.
Instead, define your base address as:
and your endpoint as:
and you'll find that your mex endpoint becomes:
Which looks about right.