从DMZ到Intranet的双工信道WCF

时间:2011-10-03 22:03:58

标签: c# .net wcf dmz duplex-channel

我们正在域内运行双渠道服务。 我们在端口20120上有TCP绑定,在端口20121上有HTTP绑定。

在DMZ(网络)中,我们想要访问此WCF服务。 防火墙似乎是从网络到服务开放的。 使用telnet,我可以访问这两个端口,我也可以从Web浏览器浏览WSDL。 现在,当我尝试从Web应用程序连接到服务时(它使用TcpBinding,我无法轻松地将其更改为HttpBinding而不重新部署新的二进制文件,这是一个痛苦的过程),我得到一个例外。

System.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

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 '00:00:59.9680000'.

System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
System.ServiceModel.Channels.ServiceChannelProxy.ExecuteMessage(Object target, IMethodCallMessage methodCall)
System.ServiceModel.Channels.ServiceChannelProxy.InvokeChannel(IMethodCallMessage methodCall)
System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout)
System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout) ...

我们的测试环境都是内联网,所以没有DMZ。在那里一切正常。

服务本身作为域用户运行,客户端服务行为已配置其userPrincipal(如username@domain.ext)。这需要访问domain.exe的域控制器吗?

我还在服务端启用了WCF日志记录,但没有任何反应。一切都很好,就像没有任何事情发生在那里。 有没有其他地方我错过了检查为什么连接下降。

EDIT1: 我写了一个小测试程序,它建立了wcf连接并调用了2个方法。 这可以在与服务相同的机器和dmz web上正常工作。 绑定设置是相同的。 (确认)。 我从dmz web机器上的普通控制台作为本地用户运行测试。任何提示?

1 个答案:

答案 0 :(得分:0)

好吧,我们将安全模式更改为无<security mode="None"/>,现在网络可以访问。我认为问题是,即使我在运行我的测试程序时使用本地用户,我曾经从域访问dmz的vpn / rdp会话在安全性中挖了一个洞,我能够连接到wcf服务。网边没有那个洞,所以失败了。