Search code examples
web-servicesrichtextboxinfopath

Using Rich Text Box with Infopath and Webservices


I would like to retrieve and submit data that contains Rich Text to a webservice but I am having problems with the particular datatype on the webservice side.

If I have a simple string type coming from the webservice, infopath will not allow a RTF box as it is not the correct datatype (which is XHTML).

Anybody have any Ideas?

Edit: Starting bounty.


Solution

  • You're correct that the Rich Text Box won't bind to a simple string. The XML Schema type would be wrong.

    If you're able to affect the schema of the webservice you're connecting to, it could be done.

    Here's some more detailed information: How to bind a Rich Text Box control to an element that is returned from a Web service in InfoPath and Visual Studio .NET 2003

    This solution works if you are able to modify the web service. On the other had, if you aren't, you'll probably have to rely on writing some code in your InfoPath form that copies the data from the webservice data to an unbound Rich Text Box and back again.

    By the way, I assume you've already used InfoPath's Rich Text Box and seen the nasty HTML that it produces. If you're going to use it, I wouldn't suggest trying to use that HTML in any way other than re-displaying it in InfoPath's Rich Text Box.