WCF 唯一基地址问题

发布于 2024-11-13 12:41:17 字数 1468 浏览 3 评论 0原文

我遇到 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

但是,我认为看这篇文章这不起作用...

net.tcp 绑定元数据问题

发帖者似乎与我有类似的配置,响应者指出每个方案中的基地址都不是“唯一的” - 但它们肯定是,因为它们都引用了两个唯一的服务?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

榆西 2024-11-20 12:41:17

您的基址不应包含服务文件名。您将在端点声明中指定这一点。

如您所见,您的要点是:

net.pipe://192.168.0.100/ProductsService/Service1.svc/mexPipe
net.pipe://192.168.0.100/ProductsService/Service2.svc/mexPipe

这肯定是不正确的,因为服务文件中没有 mex 端点的文件夹。

相反,将您的基地址定义为:

<baseAddresses>
  <add baseAddress="net.pipe://192.168.0.100/ProductsService" />
</baseAddresses>

将端点定义为:

<endpoint address="mexPipe" contract="IMetadataExchange" ... />

您会发现您的 mex 端点变为:

net.pipe://192.168.0.100/ProductsService/mexPipe

看起来不错。

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:

net.pipe://192.168.0.100/ProductsService/Service1.svc/mexPipe
net.pipe://192.168.0.100/ProductsService/Service2.svc/mexPipe

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:

<baseAddresses>
  <add baseAddress="net.pipe://192.168.0.100/ProductsService" />
</baseAddresses>

and your endpoint as:

<endpoint address="mexPipe" contract="IMetadataExchange" ... />

and you'll find that your mex endpoint becomes:

net.pipe://192.168.0.100/ProductsService/mexPipe

Which looks about right.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文