Solved

HTTP Web Response

Posted on 2013-06-19
1
260 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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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 article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

724 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