BizTalk Server General - System.security Exception with HTTP Adapter.

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > July 2005 > System.security Exception with HTTP Adapter.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author System.security Exception with HTTP Adapter.
Luis Esteban Valencia

2005-07-14, 5:51 pm

Hello I have this error when I submit the page with the following code. I
had never see this kind of errors.

I must saty that I uninstalled biztalk and sharepoint and then installed
them again, I excluded the root from the managed paths in the default
website.
Then I installes Biztalk.

Is there anything else to do.

?
Thanks

private void btnsubmit_Click(object sender, System.EventArgs e)

{

string requestLocation = "http://estacion15/HTTPSender/BTSHTTPReceive.dll";

Status.Text = "";

XmlDocument xmlDocument = new XmlDocument();

xmlDocument.PreserveWhitespace = true;

XmlNode tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element,
"Activity", "http://que.activity");

xmlDocument.AppendChild(tempXmlNode);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Attribute, "type", "");

tempXmlNode.Value = type.SelectedItem.Text;

xmlDocument.DocumentElement.Attributes.Append( (XmlAttribute)tempXmlNode);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Location", "");

tempXmlNode.InnerText = location.Text;

xmlDocument.DocumentElement.AppendChild(tempXmlNode);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Timestamp", "");

DateTime now = DateTime.Now;

tempXmlNode.InnerText = now.ToString("s");

xmlDocument.DocumentElement.AppendChild(tempXmlNode);

tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Notes", "");

tempXmlNode.InnerText = notes.Text;

xmlDocument.DocumentElement.AppendChild(tempXmlNode);

try

{

HttpWebRequest request = (HttpWebRequest)
HttpWebRequest.Create(requestLocation);

request.Method = "POST";

ASCIIEncoding encoding = new ASCIIEncoding();

byte[] requestData = encoding.GetBytes(xmlDocument.OuterXml);

request.ContentType="application/x-www-form-urlencoded";

request.ContentLength = xmlDocument.OuterXml.Length;

Status.Text += "Submitting activity message";

Stream requestStream = request.GetRequestStream();

requestStream.Write(requestData,0,requestData.Length);

requestStream.Flush();

requestStream.Close();

HttpWebResponse response = (HttpWebResponse) request.GetResponse();

StreamReader responseData = new StreamReader( response.GetResponseStream());

Status.Text = System.Web.HttpUtility.HtmlEncode( responseData.ReadToEnd()) +
"<br>";

}

catch (WebException wex)

{

Status.Text = "Unable to complete web request. Web Exception error: " +
wex.Message;

}

}



}



Error de servidor en la aplicación '/HTTPSender'.
----------------------------------------------------------------------------
----

Excepción de seguridad
Descripción: La aplicación intentó realizar una operación no permitida por
la directiva de seguridad. Para otorgar a esta aplicación los permisos
necesarios, póngase en contacto con el administrador del sistema o cambie el
nivel de confianza de la aplicación en el archivo de configuración.

Detalles de la excepción: System.Security.SecurityException: Error de
solicitud de permiso de tipo System.Net.WebPermission, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.

Error de código fuente:

[Líneas de código fuente no relevantes]

Archivo de origen: webform1.aspx.cs Línea: 84

Seguimiento de la pila:

[SecurityException: Error de solicitud de permiso de tipo
System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089.]
System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet
grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
PermissionToken permToken) +666
System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken,
CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames,
Int32 unrestrictedOverride) +0
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap,
StackCrawlMark& stackMark) +88
System.Security.CodeAccessPermission.Demand() +62
System.Net.HttpRequestCreator.Create(Uri Uri)
System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
System.Net.WebRequest.Create(String requestUriString)
HTTPSender.WebForm1.btnsubmit_Click(Object sender, EventArgs e) in
webform1.aspx.cs:84
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page. RaisePostBackEvent(IPostBackEventHandler

sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
System.Web.UI.Page.ProcessRequest()
System.Web.UI.Page.ProcessRequest(HttpContext context)

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionSte
p.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +87



----------------------------------------------------------------------------
----
Información de versión: Versión de Microsoft .NET Framework:1.1.4322.985;
Versión de ASP.NET:1.1.4322.968



Ravi Shankar

2005-07-14, 5:51 pm

register the BTSHTTPReceive.dll under ISAPI Filters and enable it (Do this
using the IIS Manager)... Also ensure that you've marked /HTTPSender as an
"unmanaged path" under WSS.

--
Ravi Shankar


"Luis Esteban Valencia" wrote:

> Hello I have this error when I submit the page with the following code. I
> had never see this kind of errors.
>
> I must saty that I uninstalled biztalk and sharepoint and then installed
> them again, I excluded the root from the managed paths in the default
> website.
> Then I installes Biztalk.
>
> Is there anything else to do.
>
> ?
> Thanks
>
> private void btnsubmit_Click(object sender, System.EventArgs e)
>
> {
>
> string requestLocation = "http://estacion15/HTTPSender/BTSHTTPReceive.dll";
>
> Status.Text = "";
>
> XmlDocument xmlDocument = new XmlDocument();
>
> xmlDocument.PreserveWhitespace = true;
>
> XmlNode tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element,
> "Activity", "http://que.activity");
>
> xmlDocument.AppendChild(tempXmlNode);
>
> tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Attribute, "type", "");
>
> tempXmlNode.Value = type.SelectedItem.Text;
>
> xmlDocument.DocumentElement.Attributes.Append( (XmlAttribute)tempXmlNode);
>
> tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Location", "");
>
> tempXmlNode.InnerText = location.Text;
>
> xmlDocument.DocumentElement.AppendChild(tempXmlNode);
>
> tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Timestamp", "");
>
> DateTime now = DateTime.Now;
>
> tempXmlNode.InnerText = now.ToString("s");
>
> xmlDocument.DocumentElement.AppendChild(tempXmlNode);
>
> tempXmlNode = xmlDocument.CreateNode(XmlNodeType.Element, "Notes", "");
>
> tempXmlNode.InnerText = notes.Text;
>
> xmlDocument.DocumentElement.AppendChild(tempXmlNode);
>
> try
>
> {
>
> HttpWebRequest request = (HttpWebRequest)
> HttpWebRequest.Create(requestLocation);
>
> request.Method = "POST";
>
> ASCIIEncoding encoding = new ASCIIEncoding();
>
> byte[] requestData = encoding.GetBytes(xmlDocument.OuterXml);
>
> request.ContentType="application/x-www-form-urlencoded";
>
> request.ContentLength = xmlDocument.OuterXml.Length;
>
> Status.Text += "Submitting activity message";
>
> Stream requestStream = request.GetRequestStream();
>
> requestStream.Write(requestData,0,requestData.Length);
>
> requestStream.Flush();
>
> requestStream.Close();
>
> HttpWebResponse response = (HttpWebResponse) request.GetResponse();
>
> StreamReader responseData = new StreamReader( response.GetResponseStream());
>
> Status.Text = System.Web.HttpUtility.HtmlEncode( responseData.ReadToEnd()) +
> "<br>";
>
> }
>
> catch (WebException wex)
>
> {
>
> Status.Text = "Unable to complete web request. Web Exception error: " +
> wex.Message;
>
> }
>
> }
>
>
>
> }
>
>
>
> Error de servidor en la aplicación '/HTTPSender'.
> ----------------------------------------------------------------------------
> ----
>
> Excepción de seguridad
> Descripción: La aplicación intentó realizar una operación no permitida por
> la directiva de seguridad. Para otorgar a esta aplicación los permisos
> necesarios, póngase en contacto con el administrador del sistema o cambie el
> nivel de confianza de la aplicación en el archivo de configuración.
>
> Detalles de la excepción: System.Security.SecurityException: Error de
> solicitud de permiso de tipo System.Net.WebPermission, System,
> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
>
> Error de código fuente:
>
> [LÃ_neas de código fuente no relevantes]
>
> Archivo de origen: webform1.aspx.cs LÃ_nea: 84
>
> Seguimiento de la pila:
>
> [SecurityException: Error de solicitud de permiso de tipo
> System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089.]
> System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet
> grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
> PermissionToken permToken) +666
> System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken,
> CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames,
> Int32 unrestrictedOverride) +0
> System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap,
> StackCrawlMark& stackMark) +88
> System.Security.CodeAccessPermission.Demand() +62
> System.Net.HttpRequestCreator.Create(Uri Uri)
> System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
> System.Net.WebRequest.Create(String requestUriString)
> HTTPSender.WebForm1.btnsubmit_Click(Object sender, EventArgs e) in
> webform1.aspx.cs:84
> System.Web.UI.WebControls.Button.OnClick(EventArgs e)
>
> System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
> stBackEvent(String eventArgument)
> System.Web.UI.Page. RaisePostBackEvent(IPostBackEventHandler

> sourceControl, String eventArgument)
> System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
> System.Web.UI.Page.ProcessRequestMain()
> System.Web.UI.Page.ProcessRequest()
> System.Web.UI.Page.ProcessRequest(HttpContext context)
>
> System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionSte
> p.Execute()
> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously) +87
>
>
>
> ----------------------------------------------------------------------------
> ----
> Información de versión: Versión de Microsoft .NET Framework:1.1.4322.985;
> Versión de ASP.NET:1.1.4322.968
>
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com