473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Receiving Data on the Same Connection Using WebRequest

Hi

We're using the following code to send an XML file to a secure server:

Dim wr As HttpWebRequest
Dim nc As NetworkCredential
Dim xd As XmlDocument
Dim xw As XmlTextWriter
Dim oItem As ListViewItem

Try
wr = CType(WebRequest.Create(goSettings.NHSDPBClaimsURL ),
HttpWebRequest)
nc = New NetworkCredential(goSettings.NHSUserName,
goSettings.NHSPassword)

wr.Credentials = nc
wr.ContentType = "text/xml"
wr.Method = "POST"

xd = New XmlDocument
xd.Load(gsAppPath & "\temp.xml")

xw = New XmlTextWriter(wr.GetRequestStream, Nothing)

xd.WriteTo(xw)

xw.Close()

Dim wresponse As HttpWebResponse = CType(wr.GetResponse(),
HttpWebResponse)

If wresponse.StatusDescription = "OK" Then....

This works beautifully, however the server sends back an XML receipt to
confirm whether the data was sent correctly or not. How do we pick up
the instantaneous response from the server so that we can process the
XML sent back?

Thanks

Jun 21 '06 #1
1 1285
Hasve you seen the Post example in the quickstart - it does seem to show you
how to obtain the reponse from a post request.

http://www.asp.net/QuickStart/util/s...clientPOST.src

--
Regards

John Timney (MVP)
"leeo" <sp**@leeottaway.plus.com> wrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
Hi

We're using the following code to send an XML file to a secure server:

Dim wr As HttpWebRequest
Dim nc As NetworkCredential
Dim xd As XmlDocument
Dim xw As XmlTextWriter
Dim oItem As ListViewItem

Try
wr = CType(WebRequest.Create(goSettings.NHSDPBClaimsURL ),
HttpWebRequest)
nc = New NetworkCredential(goSettings.NHSUserName,
goSettings.NHSPassword)

wr.Credentials = nc
wr.ContentType = "text/xml"
wr.Method = "POST"

xd = New XmlDocument
xd.Load(gsAppPath & "\temp.xml")

xw = New XmlTextWriter(wr.GetRequestStream, Nothing)

xd.WriteTo(xw)

xw.Close()

Dim wresponse As HttpWebResponse = CType(wr.GetResponse(),
HttpWebResponse)

If wresponse.StatusDescription = "OK" Then....

This works beautifully, however the server sends back an XML receipt to
confirm whether the data was sent correctly or not. How do we pick up
the instantaneous response from the server so that we can process the
XML sent back?

Thanks

Jun 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Angel | last post by:
I'm trying to connect to a fixed IP address (eg. http://10.60.903.50/TempFile) in order to retrieve one accii line of text in TempFile. I try to read the information with this code: string...
1
by: LD | last post by:
Hi, I'm pulling my hair out!! My problem is, I need to automatically upload a zip file along with 3 other pieces of text data to a web server and wait for it's xml response. Basically a...
1
by: Steve Bugden | last post by:
Hi, I am trying to use a web service on an ISPs server and keep getting the following message: "The underlying connection was closed: Unable to connect to the remote server" Fortunately (so...
5
by: Tim Reynolds | last post by:
My app calls a web service. After a few minutes of inactivity, we receive: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. A call...
5
by: Danny | last post by:
I am working on a project in which a number of client applications will be posting xml documents as a byte array to an ASP.NET page on our web server. I am trying to simulate the process and run...
0
by: Danny | last post by:
I am working on a project in which a number of client applications will be posting xml documents as a byte array to an ASP.NET page on our web server. I am trying to simulate the process and run...
0
by: pintu | last post by:
Hi..I posted my message earlier but it was not properly described..so am posting again. I am working in an application in which i hav to send the contents of an xml file(from my local machine)...
1
by: WeCi2i | last post by:
Okay, I have a problem that has been stumping me for weeks. I have tried many different solutions and this is pretty much my last resort. I have seen a lot of good answers give here so I figured I...
4
by: =?Utf-8?B?QXJuYXVkIFZpc2N1c2k=?= | last post by:
Hi all, we meet a problem since we use WCF to consume java WebServices. Often the first call works then the second raises the following error : "The underlying connection was closed : " We...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.