I am using C# to load a url. My URL is an XML document which contains the processing instruction<?xm l-Stylesheet type="text/xsl" href=".\CS_Xml_ Output.xsl"?>
During development, I was using SHDocVw.Interne tExplorer ie = new SHDocVw.Interne tExplorer(); ie.Navigate2(.. .). But since deploying to the server, I am getting the error.
System.Unauthor izedAccessExcep tion: Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80070005.
As per above advice, I tried the following. In both cases I am receiving the raw XML. How do I get get the transformed HTML? (NOTE: I cannot use XSLCompiledTran sform because the 3rd-party provided XSL uses XSLT only supported by MSXML.)
client.Headers. Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
Stream data = client.OpenRead (xmlUrl);
StreamReader reader = new StreamReader(da ta);
string s = reader.ReadToEn d();
as well as
HttpWebRequest httpRequest = (HttpWebRequest )WebRequest.Cre ate(URL.ToStrin g());
using (HttpWebRespons e httpResponse = (HttpWebRespons e)httpRequest.G etResponse())
{
Stream receiveStream = httpResponse.Ge tResponseStream ();
Encoding encode = System.Text.Enc oding.GetEncodi ng("utf-8");
StreamReader readStream = new StreamReader(re ceiveStream, encode);
Console.WriteLi ne("\r\nRespons e stream received.");
Char[] read = new Char[256];
int count = readStream.Read (read, 0, 256);
Console.WriteLi ne("HTML...\r\n ");
while (count > 0)
{
String str = new String(read, 0, count);
Console.Write(s tr);
baseRequest.App end(str);
count = readStream.Read (read, 0, 256);
}
etc....
}
Cheers!
During development, I was using SHDocVw.Interne tExplorer ie = new SHDocVw.Interne tExplorer(); ie.Navigate2(.. .). But since deploying to the server, I am getting the error.
System.Unauthor izedAccessExcep tion: Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80070005.
As per above advice, I tried the following. In both cases I am receiving the raw XML. How do I get get the transformed HTML? (NOTE: I cannot use XSLCompiledTran sform because the 3rd-party provided XSL uses XSLT only supported by MSXML.)
client.Headers. Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
Stream data = client.OpenRead (xmlUrl);
StreamReader reader = new StreamReader(da ta);
string s = reader.ReadToEn d();
as well as
HttpWebRequest httpRequest = (HttpWebRequest )WebRequest.Cre ate(URL.ToStrin g());
using (HttpWebRespons e httpResponse = (HttpWebRespons e)httpRequest.G etResponse())
{
Stream receiveStream = httpResponse.Ge tResponseStream ();
Encoding encode = System.Text.Enc oding.GetEncodi ng("utf-8");
StreamReader readStream = new StreamReader(re ceiveStream, encode);
Console.WriteLi ne("\r\nRespons e stream received.");
Char[] read = new Char[256];
int count = readStream.Read (read, 0, 256);
Console.WriteLi ne("HTML...\r\n ");
while (count > 0)
{
String str = new String(read, 0, count);
Console.Write(s tr);
baseRequest.App end(str);
count = readStream.Read (read, 0, 256);
}
etc....
}
Cheers!
Comment