IIS 7 / WAS上的WCF net.tcp端口共享 [英] WCF net.tcp port sharing on IIS 7 / WAS

查看:127
本文介绍了IIS 7 / WAS上的WCF net.tcp端口共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是wcf编程的新手,我一直在研究一个小项目,并且遇到net.tcp端口共享问题。我正在使用.net框架4和iis 7.

I am new to wcf programming and I have been working on a small project and am having problems with net.tcp port sharing. I am using .net framework 4 and iis 7.

我有两个wcf服务(serviceA和serviceB)在我们的服务器上托管在IIS上的不同网站上。每个网站都有自己的.svc文件,web.config和bin。如果我在不同的net.tcp端口上有这些服务,那么没有问题,我可以从我的电脑上的visual studio添加服务引用。服务运行正常。

I have two wcf services (serviceA and serviceB) being hosted on our server in separate websites on IIS. Each website has its own .svc file, web.config and bin. If I have each of these services on different net.tcp ports then there is no problem and I can add the service reference to each of them from visual studio on my pc. The services run fine.

然而,我们很快将启动一个包含更多服务的项目,我们希望避免为每个服务打开一个tcp端口,所以我一直在试图将serviceA和serviceB转移到端口共享。如果我在同一个端口上设置它们,那么我可以访问我添加的第一个服务,但是当我尝试访问添加到同一端口的第二个服务时,我收到以下错误:

However we will soon be starting a project with many more services and we wish to avoid having to open a tcp port for each one so I have been trying to get serviceA and serviceB to port share. If I set them up on the same port then I can access the first service I add but when when I try to access the second service added to the same port i get the following error:


元数据包含无法解析的引用:
'net.tcp:// myserver /serviceB.svc'。套接字连接已中止。这个
可能是由于处理您的消息时出错或远程主机超出接收
超时或基础网络
资源问题造成的。本地套接字超时 ** 。远程主机强行关闭
现有连接如果在当前解决方案中定义了
服务,请尝试构建解决方案
并再次添加服务引用。

Metadata contains a reference that cannot be resolved: 'net.tcp://myserver/serviceB.svc'. The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was **. An existing connection was forcibly closed by the remote host If the service is defined in the current solution, try building the solution and adding the service reference again.

我无法弄清楚出了什么问题。我已经对这个主题进行了大量搜索,并确保以下服务正在运行:

I can not work out what is going wrong. I have done a lot of searching on the subject and I have made sure that the following services are running:

Windows进程激活服务
Net.Tcp端口共享服务
Net.Tcp监听器适配器

Windows Process Activation Service Net.Tcp Port Sharing Service Net.Tcp Listener Adaptor

此外,net.tcp是网站高级设置中启用的协议。我目前最好的猜测是它可能与我在IIS管理器中定义net.tcp绑定的方式有关。我的两个运行其独立服务的网站都有以下内容:808:*(net.tcp)这是正确的吗?

In addition net.tcp is an enabled protocol in the website's advanced settings. My current best guess is that it might have something to do with how I have defined the net.tcp bindings in IIS manager. Both of my websites running their independant services have the following: 808:*(net.tcp) is this correct?

正如我之前所说的,如果设置tcp服务运行正常在两个单独的端口上,所以问题必须与端口共享有关。非常感谢任何建议

As i said earlier the tcp services run fine if set up on two separate ports so the issue must be related to the port sharing. Very grateful for any advice

推荐答案

好的,我发现了我遇到的问题。在IIS中,我将每个服务设置为自己的网站,并试图将这些不同的网站设置为端口共享。这不行。

OK I found the problem I was having. In IIS I had set up each service as its own website and was trying to get those different websites to port share. This would not work.

但是我发现,如果我只设置一个网站,然后在网站下添加我的服务作为seaprate应用程序,那么端口共享将起作用。这种方法让我可以将多个服务作为一个网站下的应用程序。

However I found that if I set up just one website and then added my services as seaprate applications under the website then the port sharing will work. This approach lets me have multiple services as applications under one website.

这篇关于IIS 7 / WAS上的WCF net.tcp端口共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆