Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

HTTP Web Response

Posted on 2013-06-19
1
Medium Priority
?
263 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
1 Comment
 
LVL 42

Accepted Solution

by:
Meir Rivkin earned 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

916 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