当我从网站调用webservice时,出现了EndpointNotFoundException
的错误,但如果我从控制台应用程序中进行相同的调用,则可以正常工作。
以下是更详细的异常信息:
Could not connect to https://******. TCP error code 10060:
A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond ***.***.***.***:443.
我确认了绑定(在web.config
和app.config
中)是相同的,所以我不明白为什么它在一种情况下有效而在另一种情况下无法使用。
<basicHttpBinding>
<binding name="ServicePortBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
如果您需要更多详细信息,请告诉我。
编辑
好的,这里有一些我忘记说的可能会导致问题的内容。所有这些都发生在公司防火墙后面。
是否因为该防火墙阻止了从现有“Web进程”生成的HTTP连接在网站上运行,而在控制台应用程序中只是单个连接?