1
I’m trying to read an XML file.
string pagina = "https://ws.pagseguro.uol.com.br/v3/transactions/notifications/5B93AB-E9FA04FA04D8-24449BAF8A80-E32467?email=diegozanardo@yahoo.com.br&token=DFA3837517594466BCC87D8F397BF15F";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(pagina));
request.Method = "POST";
request.ContentType = "application/xml";
request.Accept = "application/xml";
StreamWriter writer = new StreamWriter(request.GetRequestStream());
WebResponse res = request.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
string returnvalue = sr.ReadToEnd();
XmlDocument xm = new XmlDocument();
xm.LoadXml(returnvalue);
XmlNodeList el = xm.GetElementsByTagName("paymentLink");
Response.Redirect(el[0].InnerText);
But it generates the following line error:
WebResponse res = request.GetResponse();
Additional information: The remote server returned an error: (405) Method Not Allowed.
It looks like you’re not getting the data correctly. This
pagina
is with full address, protocol, everything?– Maniero
@bigown, added the page URL!
– Felipe
I have no experience with this, but is the fact that being HTTPS is not causing problems?
– Maniero
@bigown, I have no idea. rsrs
– Felipe