Solved

HTTP Web Response

Posted on 2013-06-19
1
259 Views
Last Modified: 2013-06-20
I have a sub that is doing a HttpWebRequest

I am getting a response...

But I need to keep the connection open and receive a continuing response stream of xml

The "XML bursts" will come though every second or so

Example
I post this
<command>
   <phoneID> 123</phoneID>
</command>

I get back initially...
<Result xsi:type="org.m5.data.v2.cti.HostedConnectObject" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <csta:MonitorStartResponse>
       <csta:monitorCrossRefID>243</csta:monitorCrossRefID>
   </csta:MonitorStartResponse>
</Result>

and then in an ongoing "monitoring" I will get back every few seconds any phone call actions xml and if no calls on the phone...every 30 seconds
<Response>
   <monitoring>243</monitoring>
</Response>

My problem is that I'm getting back the initial response...and then the thread closes

How do I keep this response "stream???" open and close ONLY on response being idle for 2 minutes?
0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39261949
use BeginGetRequestStream which uses asynchronous request.
check example here:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetrequeststream.aspx
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question