Link to home
Start Free TrialLog in
Avatar of Evan Cutler
Evan CutlerFlag for United States of America

asked on

passing html to webservice (asmx) for invoke

Greetings,
I have a WDSL XML Webservice:
It asks for four fields,

However one of my fields is html from a Textarea (like fckeditor).
it is erroring out...how do I get the HTML through so the String parameter can catch it in the webservice function, so it can be uploaded into a RMDB?

Thanks
Avatar of Sudaraka Wijesinghe
Sudaraka Wijesinghe
Flag of Sri Lanka image

Not sure what you mean by "erroring out", but probably you need to encode the HTML in HTTP transfer and/or DB update.
Please provide more details on the exact error(s) you get.
Avatar of Evan Cutler

ASKER

this is the error I get:
System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (text="<p><strong><font siz...").
   at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
   at System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection)
   at System.Web.HttpRequest.get_Form()
   at System.Web.Services.Protocols.HtmlFormParameterReader.Read(HttpRequest request)
   at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
   at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
A quick google of that error shows you can avoid it by setting the validateRequest to false. I'm not familiar with .Net technology so I don't know if this make the application vulnerable in some way.

http://www.daniweb.com/web-development/aspnet/threads/26790
http://www.aspsnippets.com/Articles/A-potentially-dangerous-RequestForm-value-was-detected-from-the-client.aspx
ASKER CERTIFIED SOLUTION
Avatar of godeschalk
godeschalk
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't like it, sounds bad, but it works....

fortunately the cleditor I'm using, has a small amount of XSS protection.

Cheers.
THanks.