Receiving Data on the Same Connection Using WebRequest

L

leeo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top