English 中文(简体)
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.

最佳回答

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.

问题回答

create a custom reference on the xml file like as below

    **<xsd:element name="myxhtmltest">
  <xsd:complexType mixed="true">
    <xsd:sequence>
      <xsd:any namespace="http://www.w3.org/1999/xhtml" processContents="lax"
    minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>**

Then use the above tag as reference where the element is **<s:element ref="tns:myxhtmltest" minOccurs="0" maxOccurs="1"/>**





相关问题
IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

ASP.net web services

I am using a web service which sets the Thread.CurrentPrincipal object while logging in and soon later when another webmethod of the same web service accesses Thread.CurrentPrincipal, its different/...

Unity Container Disposing and XML Web Service

I am registering some wrapers over un-managed objects in container. How can I dispose of them at the end of the container s lifetime? Please bear in mind I have an XML Web service.

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

热门标签