托管在外部 Windows 服务中的 WCF 服务中的“无端点侦听”
"No Endpoint Listening” in WCF Service Hosted in external Windows Service
我正在对现有应用程序进行一些代码重构。
该应用程序已经托管并且运行良好。
我有一个由外部 Windows 服务托管的 WCF 服务。
的确,我在本地工作,我正在尝试在 Pre prod 环境中测试一些代码实现。
所以,这是 basicHttpBinding 代码中的代理配置:
<bindings>
<basicHttpBinding>
<!--proxy configuration must be provided-->
<binding name="BindingTimeSheet" maxReceivedMessageSize="6000000" useDefaultWebProxy="false" proxyAddress="http://xxx.xxx.x.x:xxxx" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00">
<readerQuotas />
<security mode="Transport">
<transport clientCredentialType="Ntlm" />
</security>
</binding>
</basicHttpBinding>
</bindings>
这是项目服务器端点配置:
<client>
<endpoint address="https://xxxxxxxxxx.asmx" binding="basicHttpBinding" bindingConfiguration="BindingTimeSheet" contract="ProxyClientJeanDoe.JeanDoeSoap" name="JeanDoeSoap" />
</client>
我收到了这个异常:
Inner Exception 1: EndpointNotFoundException: There was no listening
endpoint on https://xxxxxxx.asmx that could accept the message. This
is often due to an incorrect address or SOAP action. If present, see
the InnerException element for more information.
Inner Exception 2: WebException: Can not connect to remote server
Inner Exception 3: SocketException: A connection attempt failed
because the connected party did not respond properly after a certain
amount of time or an established connection failed because the login
host did not respond xxx.xxx.xx.x:xxxx
我测试了 WSDL 服务,它们工作正常,但代理地址没有响应
我已经尝试启用匿名身份验证,并且我在使用代理服务器连接 Internet 的本地计算机上工作,出于安全原因无法配置防火墙。
感谢您的理解
最后,问题与 BypassProxyOnLocal 标志有关。
它已启用,因此对本地 Internet 资源的请求未使用代理服务器。
此配置放入 Web.config 工作正常。
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy usesystemdefault="True" proxyaddress="http://xxxxxxxxxxx:8080"
bypassonlocal="False"/>
</defaultProxy>
</system.net>
谢谢。
我正在对现有应用程序进行一些代码重构。
该应用程序已经托管并且运行良好。
我有一个由外部 Windows 服务托管的 WCF 服务。
的确,我在本地工作,我正在尝试在 Pre prod 环境中测试一些代码实现。
所以,这是 basicHttpBinding 代码中的代理配置:
<bindings>
<basicHttpBinding>
<!--proxy configuration must be provided-->
<binding name="BindingTimeSheet" maxReceivedMessageSize="6000000" useDefaultWebProxy="false" proxyAddress="http://xxx.xxx.x.x:xxxx" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00">
<readerQuotas />
<security mode="Transport">
<transport clientCredentialType="Ntlm" />
</security>
</binding>
</basicHttpBinding>
</bindings>
这是项目服务器端点配置:
<client>
<endpoint address="https://xxxxxxxxxx.asmx" binding="basicHttpBinding" bindingConfiguration="BindingTimeSheet" contract="ProxyClientJeanDoe.JeanDoeSoap" name="JeanDoeSoap" />
</client>
我收到了这个异常:
Inner Exception 1: EndpointNotFoundException: There was no listening endpoint on https://xxxxxxx.asmx that could accept the message. This is often due to an incorrect address or SOAP action. If present, see the InnerException element for more information.
Inner Exception 2: WebException: Can not connect to remote server
Inner Exception 3: SocketException: A connection attempt failed because the connected party did not respond properly after a certain amount of time or an established connection failed because the login host did not respond xxx.xxx.xx.x:xxxx
我测试了 WSDL 服务,它们工作正常,但代理地址没有响应
我已经尝试启用匿名身份验证,并且我在使用代理服务器连接 Internet 的本地计算机上工作,出于安全原因无法配置防火墙。
感谢您的理解
最后,问题与 BypassProxyOnLocal 标志有关。 它已启用,因此对本地 Internet 资源的请求未使用代理服务器。
此配置放入 Web.config 工作正常。
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy usesystemdefault="True" proxyaddress="http://xxxxxxxxxxx:8080"
bypassonlocal="False"/>
</defaultProxy>
</system.net>
谢谢。