Übertragen eines XML-Strings von Front- an Backend

  • VB.NET (ASP)

    Übertragen eines XML-Strings von Front- an Backend

    EDIT: Kann das von einem Admin bitte verschoben werden? Hatte mich in der Kategorie verguckt...

    Hallo,

    ich möchte von meinem Frontend mittels eines Formulars über POST-Methode einen XML-String (den der User bearbeiten können soll) an den Backend übertragen.

    Der String wird weder in eine Datenbank geschrieben noch wird damit irgendwas gemacht, was den Benutzer gefährden könnte. Ich schreiben diesen String lediglich in eine Datei.

    Nun bekomme ich aber folgende elend lange Fehlermeldung:

    Spoiler anzeigen
    A potentially dangerous Request.Form value was detected from the client (NewXMLContent="<?xml version="1.0" ...").Description: ASP.NET has detected data in the request that is potentially dangerous because it might include HTML markup or script. The data might represent an attempt to compromise the security of your application, such as a cross-site scripting attack. If this type of input is appropriate in your application, you can include code in a web page to explicitly allow it. For more information, see go.microsoft.com/fwlink/?LinkID=212874.

    Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (NewXMLContent="<?xml version="1.0" ...").

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:

    [HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (NewXMLContent="<?xml version="1.0" ...").]
    System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +9695101
    System.Web.HttpRequest.ValidateHttpValueCollection(HttpValueCollection collection, RequestValidationSource requestCollection) +184
    System.Web.HttpRequest.get_Form() +55
    System.Web.HttpRequestWrapper.get_Form() +9
    System.Web.Mvc.FormValueProvider..ctor(ControllerContext controllerContext) +88
    System.Web.Mvc.FormValueProviderFactory.GetValueProvider(ControllerContext controllerContext) +117
    System.Web.Mvc.<>c__DisplayClass6.<GetValueProvider>b__1(ValueProviderFactory factory) +59
    System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +145
    System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +85
    System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +381
    System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
    System.Web.Mvc.ValueProviderFactoryCollection.GetValueProvider(ControllerContext controllerContext) +417
    System.Web.Mvc.ControllerBase.get_ValueProvider() +85
    System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +154
    System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +199
    System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +844
    System.Web.Mvc.Controller.ExecuteCore() +130
    System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +123
    System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +39
    System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +68
    System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +44
    System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +42
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +152
    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
    System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +63
    System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9659272
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155


    Die einschlägigen Behebungsvorschläge a'la

    Quellcode

    1. <@ Page validateRequest="false" %>


    oder

    Quellcode

    1. <location path="test.aspx">
    2. <system.web>
    3. <httpRuntime requestValidationMode="2.0" />
    4. </system.web>
    5. </location>


    habe ich bereits ohne Erfolg versucht.
    Kann mir da jemand weiterhelfen?

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Snickbrack“ ()