473,480 Members | 3,796 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XML Posting to Web Service Problems

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

May 25 '06 #1
1 1101
Thus wrote mi**************@gmail.com,
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


Why did you remove the call to Dispose()? You must close the request stream.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
May 27 '06 #2

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

Similar topics

7
7079
by: David Laub | last post by:
I've also posted this issue to a Sun/java formum, but since it appears to be an integration issue, this may be the better place to posr: I have written a dot net/c# Web Services doesn't fully...
1
3660
by: Lee Greco | last post by:
I'm looking for some advice on how to proceed. Here's the scenario: I've got to develop a high availability VB.Net web service that basically acts as a middle man between the web service...
2
2242
by: Esa | last post by:
Hi, I'm having problems with one strange web system where submitting an application and making queries about its handling status require a series of form submits and response parsing - all in...
3
6596
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
3
1816
by: Russ | last post by:
I have a Web Service that was originally created with .NET VC 2003, and subsequently converted to the 2005 version. It works fine when built as a debug version, and run on the workstation it was...
0
7040
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
6905
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
7041
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
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4478
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.