将富文本框与 Infopath 和 Web 服务结合使用
我想检索包含富文本的数据并将其提交到 Web 服务,但我在 Web 服务端的特定数据类型上遇到问题。
如果我有一个来自网络服务的简单字符串类型,infopath 将不允许 RTF 框,因为它不是正确的数据类型(即 XHTML)。
有人有什么想法吗?
编辑:开始赏金。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是对的,富文本框不会绑定到简单的字符串。 XML 模式类型可能是错误的。
如果您能够影响您正在连接的 Web 服务的架构,那么这是可以做到的。
以下是一些更详细的信息:如何将富文本框控件绑定到从 Web 服务返回的元素在 InfoPath 和 Visual Studio .NET 2003 中
如果您能够修改 Web 服务,则此解决方案有效。另一方面,如果您不这样做,您可能必须依赖在 InfoPath 表单中编写一些代码,将数据从 Web 服务数据复制到未绑定的富文本框,然后再复制回来。
顺便说一句,我假设您已经使用过 InfoPath 的富文本框并看到了它生成的令人讨厌的 HTML。如果您打算使用它,我不建议尝试以任何方式使用该 HTML,除非在 InfoPath 的富文本框中重新显示它。
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.
在 xml 文件上创建自定义引用,如下所示
然后使用上面的标签作为元素所在位置的引用
****
create a custom reference on the xml file like as below
Then use the above tag as reference where the element is
**<s:element ref="tns:myxhtmltest" minOccurs="0" maxOccurs="1"/>**