?
Solved

HTTP Web Response

Posted on 2013-06-19
1
Medium Priority
?
261 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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

743 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