Network programming

riversr

Member
Joined
Oct 30, 2006
Messages
12
Programming Experience
3-5
I need to write a small vb.net application that will send a request to a https web server and receive a XML string back. The request will look roughly like this:

https://www.webserver.com/dir1/dir2/filename.php?param1=text&param2=text&param3=text

The string that it gets back will be XML. It will look roughly like this:

HTML:
<?xml version="1.0"?>
<Card>
<errorCode>000</errorcode>
<value>1234</value>
</Card>
My problem is that I have never done this sort of thing for a web server that requires HTTPS. I don't have a lot of experience with this period, but especially using HTTPS. I am familiar with WebRequest and HttpWebRequest. I have used them to do some simple screen scraping programs. I know that I have to deal with credentials, certificates, etc for HTTPS, but cant' seem to find a discussion of this topic. Can anyone point me to a tutorial or any resource that will help me learn how to do this.

Thanks for any help.

rivers
 
I think this should work:
VB.NET:
Dim webc As New Net.WebClient
webc.Credentials = New Net.NetworkCredential("username", "password")
Dim xmldoc As New Xml.XmlDocument
xmldoc.LoadXml(webc.DownloadString("https://address/"))
 
No work...

I tried your example with no luck. I can enter my https request into IE and it works fine but when I put it in this example code, I get nothing back in the XML document. It still has no value(NULL).

Any other suggestions?

I would also appreciate any reccomendations for good books on this topic.

Thanks,
 
You don't have to set username+password if you don't when browsing the url with IE. The webclient supports https by default. Did you also see what string was returned by DownloadString method? The XmlDocument throws an exception if LoadXml isn't providing a valid xml document string.
 
Back
Top