|
-
Mar 20th, 2008, 05:24 AM
#1
Thread Starter
Junior Member
HttpWebRequest with XML-file
Hey,
I'm developping the client-side of a webservice. The purpose is that I send three values to the server (xml-file, username and password) and I will get an xml-file in return.
I'm allready able to send information to the webservice but then it 'hangs' and my application is blocked.
How should I attach the xml-file to the webrequest?? What contentType is needed?? More suggestions??
Code:
Dim request As Net.HttpWebRequest = DirectCast(WebRequest.Create(strUrl), HttpWebRequest)
request.Method = "post"
request.ContentLength = "12000"
request.ContentType = "multipart/form-data"
Dim response As Net.HttpWebResponse = CType(request.GetResponse, Net.HttpWebResponse)
Thanks for the effort to try and find me a solution.
-
Mar 20th, 2008, 06:52 AM
#2
Re: HttpWebRequest with XML-file
I believe the ContentType should be text/xml. Have a look at MSDN's example on posting data to a website.
-
Mar 20th, 2008, 10:44 AM
#3
Hyperactive Member
Re: HttpWebRequest with XML-file
Athiest is correct, response type needs to be "text/xml", also the request content type might need to be "application/x-www-form-urlencoded"
Do you wake up in the morning feeling sleepy and grumpy? Then you must be Snow White
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|