Microsoft
Software
Hardware
Network
Question : Should I use HTTPWebRequest or TCP sockets to retrieve XML from HTTPS link
Hello Experts,
I have been trying to solve this problem for some time now.
Our company receives an email with a HTTPS link("
https://somedomain.c
om/Display
.xml?refer
ralID=5319
582
") to an XML document. When we click on the link, a dialog box pops up where we are asked to enter our username and password. After successful authentication, the XML displays in the browser window itself.
I wrote some code to automate this process through an ASP.net C# console application using the following code through HTTPWebRequest.
HttpWebRequest request = (System.Net.HttpWebRequest
)HttpWebRe
quest.Crea
te("
https:
//somedoma
in.com/Dis
play.xml?r
eferralID=
5319582
");
request.ContentType = "text/html";
request.Credentials = new System.Net.NetworkCredenti
al("userna
me","passw
ord");
// Get the stream associated with the response.
HttpWebResponse response = (HttpWebResponse)request.G
etResponse
();
But this is not working. I get the following error: “The remote server returned an error: (403) Forbidden”. I am stuck here as I cannot parse the XML until I can get past this. Should I be using sockets instead?
Please advise.
Answer : Should I use HTTPWebRequest or TCP sockets to retrieve XML from HTTPS link
http://us.php.net/manual/e
n/function
.htmlentit
ies.php
Super easy: htmlentities($string)
and to convert it back:html_entity_decode($s
tring)
Random Solutions
Video Chat Capabilities
A non-SYN packet was dropped because it was sent by a source that does not have an established connection with the Forefront TMG computer
Does this HP ML370 G3 server support 64-bit OS?
How can I connect printer to a computer using another computer.
Access: 'Control can't be edited - bound to unknown field'
Blackberry Users can receive but not send
How do I add buttons on a PDF form to add/remove rows of data?
run excel and run the enable auto refresh
how many version of SQL Server on one machine
Virtual Data Recovery Error