HttpWebRequest timeout on alpha
Hi,
I am using the C# method below to get JSON data from a Jboss Application server
Method is used in Eikon WebApp under file WebCAllableFunctions.cs
public string GetEsJson(string query, string body, IAppServerServices services)
{
string json = null;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(body);
request.Timeout = 600000;
try
{
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
response.Close();
HttpStatusCode statusCode = response.StatusCode;
if (HttpStatusCode.OK.Equals(statusCode))
{
using (responseStream)
{
StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
json = reader.ReadToEnd();
}
}
}
catch (WebException ex)
{
System.Diagnostics.Debug.WriteLine(ex);
}
return json;
}
The above HttpWebRequest is timing out on Alpha, the same request is working fine locally
I tried to increase the timeout (request.Timeout = 600000) but it doesn't seem to have any impact, the request is always timing out after 40 seconds
Any help appreciated
Thanks
I am using the C# method below to get JSON data from a Jboss Application server
Method is used in Eikon WebApp under file WebCAllableFunctions.cs
public string GetEsJson(string query, string body, IAppServerServices services)
{
string json = null;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(body);
request.Timeout = 600000;
try
{
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
response.Close();
HttpStatusCode statusCode = response.StatusCode;
if (HttpStatusCode.OK.Equals(statusCode))
{
using (responseStream)
{
StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
json = reader.ReadToEnd();
}
}
}
catch (WebException ex)
{
System.Diagnostics.Debug.WriteLine(ex);
}
return json;
}
The above HttpWebRequest is timing out on Alpha, the same request is working fine locally
I tried to increase the timeout (request.Timeout = 600000) but it doesn't seem to have any impact, the request is always timing out after 40 seconds
Any help appreciated
Thanks
Tagged:
1
Answers
-
We need a little more information in terms of whether this piece of code is calling the same server from both Alpha and your workstation; but for the sake of expediency, let's assume it is. The fact that you are getting a connection timeout, implies that there's either a routing issue or a firewall from Alpha to your JBoss endpoint. I will exclude Proxy issues since you haven't mentioned you are using one. If I where to choose between routing and firewall, I would be going for the firewall issue first, then look at routing. On a separate note: Instead of treating JSON as a String, try using `Windows.Data.Json`. It gives you access to a JsonObject and friends, which you should return, instead of a null String.0
-
Both Alpha and locally are calling the same server, on Alpha if the server responds in less than 40 seconds its working fine and I get to download my response, locally it wouldn't timeout even after 40 seconds
Thanks!0 -
To me then, it seems that some network appliance between Alpha and the server is imposing a 40sec connection timeout. Bear in mind, that the .Timeout property, is for the entirety of the request, not just the stream reading part.0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛