How to quickly edit multiple Web Service urls inside an InfoPath formNovember 10, 2007 20:06
One of my current projects included 5 InfoPath forms with each 6 web services. Clicking through the Data Connection Wizard to update the url would take quite some time and I only needed to change the location. My test environment used the same web service as in production, but because of the different server name I had to update the urls to make the InfoPath forms work. I found some interesting instructions in the InfoPath documentation and I decided to take it to the test. It turned out to be a good and quick way to update the urls. If you are facing the same situation as me follow these steps: Tags: connection wizard, data connection, Infopath, manifest, source files, web service.InfoPath IXMLDOMDocument: Reference to undeclared namespace prefixOctober 30, 2007 12:00
Trying to set a query property in the DOM of a data source I received the error “Reference to undeclared namespace prefix: ‘tns’”. The reason of this error is that the xml contains multiple namespaces and that you have to explicitly define the namespace to use. By default the DOM property you can access from the XDocument are of the type IXMLDOMDocument. But working with this type, does not allow you to set the required namespace for your selections. To get around the issue convert the IXMLDOMDocument to a IXMLDOMDocument2 which makes it possible to define a “SelectionNamespaces” property. If you fill this property with the required documentElement’s namespace, the xpath selection of your node will succeed and the error is gone. Below is an example of the Data source’s IXMLDOMDocument2 content (xml) and some demo code to select the required node. Tags: data source, Infopath, interop, IXMLDOMDocument, namespace prefix, node, xml. |
||