终于搞定 RosettaNet 大文件PIP 公网传送问题
, 其实很简单,就是几个地方设置调整
1.Web.config 调整httpRuntime, executionTimeout, maxRequestLength;
<configuration>
<system.web>
...
<httpRuntime executionTimeout="3600" maxRequestLength="1024000"/>
2. 修改 RosettaNet Gateway WebApp
private static HttpWebRequest CreateOuterHttpRequest(Uri url)
{
HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create(url);
string webProxyUrl = System.Configuration.ConfigurationManager.AppSettings["WebProxyUrl"];
if (webProxyUrl != null && webProxyUrl.Length > 0)
{
WebProxy webproxy = new WebProxy();
webproxy.Address = new Uri(webProxyUrl);
request.Proxy = webproxy;
}
request.KeepAlive = false;
//request.ProtocolVersion = HttpVersion.Version10;
request.Timeout = 7200000;
request.ReadWriteTimeout = 7200000;
request.PreAuthenticate = true;
request.Credentials = CredentialCache.DefaultCredentials;
request.Method = "POST";
return request;
}