我们有一个由windows-service和一个控制台应用程序组成的解决方案,它作为一个引导程序,为工作项调用WCF服务。
除了在客户环境中运行解决方案时,所有这一切都正常工作,客户环境位于http代理后面的封闭网络中以进行外部访问。一切都按预期工作,直到引导程序调用WCF服务,24s退出后出现以下错误:
System.ServiceModel.EndpointNotFoundException:https://www.MyDomian.com/MyService.svc等没有端点监听...
现在,这是踢球者。如果我手动启动引导程序(双击exe),它会毫无问题地连接到WCF服务。
已知事实
代码windows-service用于启动引导程序:
var p1 = new Process{StartInfo = { UseShellExecute = false, FileName = MyConsoleApplication.exe } };
p1.StartInfo.UseShellExecute = false;
p1.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
p1.StartInfo.RedirectStandardInput = true;
p1.StartInfo.RedirectStandardError = true;
p1.StartInfo.RedirectStandardOutput = true;
p1.Start();
主机上的WCF配置:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="MyBinding"
maxReceivedMessageSize="500000"
maxBufferSize="500000"
maxBufferPoolSize="500000"
receiveTimeout="00:02:00"
sendTimeout="00:02:00"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service
name="MyService"
behaviorConfiguration="MyServiceBehavior">
<endpoint address=""
binding="basicHttpBinding"
contract="IMyService"
bindingConfiguration="MyBinding"/>
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<serviceMetadata httpsGetEnabled="true" policyVersion="Policy15" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
客户端上的WCF配置:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="MyBinding"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
receiveTimeout="00:02:00"
sendTimeout="00:02:00"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint name="MyService"
address="https://www.MyDomian.com/MyService.svc"
binding="basicHttpBinding"
contract="IMyService"
bindingConfiguration="MyBinding"/>
</client>
到目前为止已经尝试过:
更新1
将此添加到WCF客户端配置
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy
proxyaddress="http://proxy.customerDomain.com:8080/"
bypassonlocal="True"
scriptLocation="http://config.customerDomain.com/proxy.pac"/>
</defaultProxy>
我们错过了什么和/或对可能导致此问题的任何建议?
由于