Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Asp.Net and XML

Reply
Thread Tools

Asp.Net and XML

 
 
Alexander
Guest
Posts: n/a
 
      01-14-2010
Hi,
I'm writing an application that use an Asp.Net Application to
send/recive data from a database (MS SQL Server).
To send/recive data i use XML. From ASP to the other application all
work fine.
But when I try to send XML data as a parameter from the other
application to the Asp.Net application I get an exception.
Asp.Net dosen't acept charters like "<" or ">" with same text inside:
"<text>".
Dose anyone know how i can send XML code like parameter to ASP?

Thaks

Alexander

 
Reply With Quote
 
 
 
 
Alexander
Guest
Posts: n/a
 
      01-14-2010
thanks for the reply,



> Is this a homework exercise? If not, it sounds very much like you are
> making things much more difficult for yourself than they need to be...
>



No is not an homework exercice.


>
>> From ASP to the other application all work fine.

>
> The other application...?
>
>> But when I try to send XML data as a parameter from the other
>> application to the Asp.Net application I get an exception.
>> Asp.Net dosen't acept charters like "<" or ">" with same text inside:
>> "<text>".

>
> Can you please explain in more detail precisely what you are trying to
> do? A code example would be appreciated too...


Ok I explain better:

My first application is a clinet-side Adobe Flex application. This
application must read and write data on a MS SQL Server. To do this I
use HTTP Post method and an Asp.Net application:

this is the code that i use in the asp application to read the XML
parameter:

....
private void Page_Load(object sender, EventArgs e)
{
...
switch (Request["Call"])
{
...

case "SaveData":
MyFunction(Request["XML"]);
break;

...
}
....

But when i execute the comand to send XML data in the flex application i
obtain an error. The Flex code is correct (I test the same code with a
PHP/MySql application that work fine).

So the problem is that Asp.Net not acept string like "<sometext>" as
paramters.

Wath can i do?

Thanks





 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      01-14-2010
Alexander wrote:

> So the problem is that Asp.Net not acept string like "<sometext>" as
> paramters.


What exactly happens? Do you get a HttpRequestValidationException
exception? In that case the documentation
http://msdn.microsoft.com/en-us/libr...exception.aspx
suggests you have some options to avoid that:

"Request validation detects potentially malicious client input and
throws this exception to abort processing of the request. A request
abort can indicate an attempt to compromise the security of your
application, such as a cross-site scripting attack. It is strongly
recommended that your application explicitly check all input regarding
request aborts. However, you can disable request validation by setting
the validateRequest attribute in the @ Page directive to false, as shown
in the following example:

<%@ Page validateRequest="false" %>

To disable request validation for your application, you must modify or
create a Web.config file for your application and set the
validateRequest attribute of the pages section to false, as shown in the
following example:

<configuration>
<system.web>
<pages validateRequest="false" />
</system.web>
</configuration>

"


--

Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
 
Reply With Quote
 
Alexander
Guest
Posts: n/a
 
      01-14-2010

> To disable request validation for your application, you must modify or
> create a Web.config file for your application and set the
> validateRequest attribute of the pages section to false, as shown in the
> following example:
>
> <configuration>
> <system.web>
> <pages validateRequest="false" />
> </system.web>
> </configuration>
>
> "
>
>


Thanks, Thanks a lot!!! I had this setting in mio Web.config file and
all work perfectly.
Thanks again!

Alenxader
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ElementTree.XML(string XML) and ElementTree.fromstring(string XML)not working Kee Nethery Python 12 06-27-2009 06:06 AM
[Announce] Stylus Studio 2007 XML Enterprise Suite Released: XML Pipeline, XML Publishing and Data Conversion API's stylusstudio@gmail.com Java 0 09-26-2006 05:04 PM
[ANN] Stylus Studio 2007 XML Enterprise Suite Released: XML Pipeline, XML Publishing and Data Conversion API's Stylus Studio XML 0 09-26-2006 04:49 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
What XML technologies to learn first for "XML Processing" and "XML Mapping"? Bomb Diggy Java 0 07-28-2004 07:26 AM



Advertisments