: 오류 Sourse "작업이 초과되었습니다"System.Net.httpWebRequest.GetResponse (에서)System.Net.WebRequest - 시간 초과 오류
이를 메서드는 URL을 호출하고 응답 객체를 가져 오는 중입니다.
참고 :이 내가 production..it에 동일한 코드를 보내 내 end..but의 모든 작업을 잘 시간 oout 오류
public GetUpdatedInventoryUnitValues(Vehicle aeVehicle)
{
WebRequest oWebRequest = null;
StringBuilder oStringBuilder = null;
StreamReader oStreamReader = null;
dcDealerDetails = new Dictionary<string, string>();
MSRP = string.Empty;
NetPrice = string.Empty;
string strLine = string.Empty;
string strURL = GetUpdatedInventoryUnitValues.GetFormattedURL(aeVehicle);
try
{
/* Open the requested URL */
oWebRequest = WebRequest.Create(strURL);
oWebRequest.Method = "GET";
oWebRequest.ContentType = "application/xml";
/* Get the stream from the returned web response */
oStreamReader = new StreamReader(oWebRequest.GetResponse().GetResponseStream());
/* Get the stream from the returned web response */
oStringBuilder = new StringBuilder();
/* Read the stream a line at a time and place each one into the stringbuilder */
while ((strLine = oStreamReader.ReadLine()) != null)
{
/* Ignore blank lines */
if (strLine.Length > 0)
oStringBuilder.Append(strLine);
}
string[] tempArray = null;
string[] tempNextArray = null;
//Split string by semicolon as a separater
tempArray = Data.SplitString(oStringBuilder.ToString(), new char[] { ';' });
if (tempArray != null)
{
foreach (string invUnits in tempArray)
{
//Split string by '=' as a separater
tempNextArray = Data.SplitString(invUnits, new char[] { '=' });
if (tempNextArray != null && tempNextArray.Length == 2)
{
switch (tempNextArray[0].ToLower())
{
//case "msrp":
// MSRP = Data.RemoveDoubleCode(tempNextArray[1]);
// break;
case "netprice":
NetPrice = Data.RemoveDoubleCode(tempNextArray[1]);
break;
}
}
}
}
}
catch (Exception ex)
{
ErrorLog.ErrorMessage = ErrorLog.Separator;
ErrorLog.ErrorMessage = "Exception during posting data to another application .";
ErrorLog.ErrorMessage = "ERROR MESSAGE : " + ex.Message;
ErrorLog.ErrorMessage = "ERROR SOURCE: " + ex.StackTrace.ToString();
}
finally
{
if (oStreamReader != null)
{
oStreamReader.Close();
}
if (oWebRequest != null)
{
oWebRequest = null;
}
}
}
내가 잘못하고 또는 실종 무엇을 제안하십시오
을 보여줍니다?
당신은 확실 요청 좋은이며 코드에서 타임 아웃하지 않습니다 ... 문제를 해결? 브라우저에서 직접 실행하려고 했습니까? –
내 마지막에는 괜찮습니다.하지만 같은 코드를 생산품에 보내면 시간이 오래 걸립니다. –
개발 플랫폼과 생산 플랫폼의 차이점은 무엇입니까? 귀하의 요청을 막을 수있는 방화벽 또는 이와 유사한 것이 있습니까? –