M
michael.esposito
I am having issues with this code. It posts the XML file to the web
service without a problem, but when I go to get the response, it times
out. Even when the timeout was set to infinite, it ran all night
without any response. Anyone know what might be wrong?
Thanks,
Michael
Dim strURL As String = "http://webservice:8080/"
'Set path of xml file to pass via HTTP
Dim xmlPath As String = "C:\Test\map_test.xml"
'Send XML document to receving page and print result
' open the document...
Dim clsDocument As New System.Xml.XmlDocument
clsDocument.Load(xmlPath)
' create a request class...
Dim clsRequest As System.Net.WebRequest =
System.Net.HttpWebRequest.Create(strURL)
clsRequest.Timeout = System.Threading.Timeout.Infinite
clsRequest.Credentials = New
System.Net.NetworkCredential("username", "password")
clsRequest.Method = "POST"
' get request stream and write document to it...
Dim clsStream As System.IO.Stream =
clsRequest.GetRequestStream() 'TIMEOUT
clsDocument.Save(clsStream)
' close the stream...
clsStream.Flush()
'clsStream.Dispose()
clsStream = Nothing
service without a problem, but when I go to get the response, it times
out. Even when the timeout was set to infinite, it ran all night
without any response. Anyone know what might be wrong?
Thanks,
Michael
Dim strURL As String = "http://webservice:8080/"
'Set path of xml file to pass via HTTP
Dim xmlPath As String = "C:\Test\map_test.xml"
'Send XML document to receving page and print result
' open the document...
Dim clsDocument As New System.Xml.XmlDocument
clsDocument.Load(xmlPath)
' create a request class...
Dim clsRequest As System.Net.WebRequest =
System.Net.HttpWebRequest.Create(strURL)
clsRequest.Timeout = System.Threading.Timeout.Infinite
clsRequest.Credentials = New
System.Net.NetworkCredential("username", "password")
clsRequest.Method = "POST"
' get request stream and write document to it...
Dim clsStream As System.IO.Stream =
clsRequest.GetRequestStream() 'TIMEOUT
clsDocument.Save(clsStream)
' close the stream...
clsStream.Flush()
'clsStream.Dispose()
clsStream = Nothing