Avatar of Evan Cutler
Evan Cutler
Flag for United States of America asked on

passing html to webservice (asmx) for invoke

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?

XMLWeb ServicesJavaScript

Avatar of undefined
Last Comment
Evan Cutler

8/22/2022 - Mon
Sudaraka Wijesinghe

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.
Evan Cutler

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()
Sudaraka Wijesinghe

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.

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Evan Cutler

I don't like it, sounds bad, but it works....

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