Hi Scott,
Yes, thank you! I had not been able to find a way to correctly reference
the "tns" namespace. The other references I found just pointed to
tempuri.org without the virtual directory.
I also wondered whether there was a way to programmatically update the web
service being used by the secondary datasource, in case the web service path
changes.
-- Liz
> Hi,
>
[quoted text clipped - 50 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 01 Sep 2005 15:07 GMT
Hi Liz,
Yes - you can change the web service using code - it is a little involved.
Take a look at the following post:
http://groups.google.com/group/microsoft.public.infopath/browse_thread/threa
d/82d86a335e866076/faa8f953f1f34565?lnk=st&q=infopath+%22web+service%22+chan
ge&rnum=8&hl=en#faa8f953f1f34565
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights
liz-kma - 01 Sep 2005 17:23 GMT
Hi Scott,
Very helpful and quite easy! I altered it a bit for web services:
var objWSAdapter;
objWSAdapter = XDocument.DataObjects("MySecondaryDataSource").QueryAdapter;
var tmpXmlDoc = new ActiveXObject("msxml2.domdocument.5.0");
tmpXmlDoc.setProperty("SelectionNamespaces","xmlns:xsf='http://schemas.microsoft.com/office/infopath/2003/solutionDefinition'");
tmpXmlDoc.loadXML(objWSAdapter.Operation);
XDocument.UI.Alert(objWSAdapter.Operation);
var serviceUrlNode =
tmpXmlDoc.documentElement.selectSingleNode("@serviceUrl");
XDocument.UI.Alert("Before: " + serviceUrlNode.text);
serviceUrlNode.text = "http://newwebservicepath/";
XDocument.UI.Alert("After: " + serviceUrlNode.text);
// Save your changes!
objWSAdapter.Operation = tmpXmlDoc.xml;
-- Liz
> Hi Liz,
>
[quoted text clipped - 9 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 01 Sep 2005 18:43 GMT
Liz,
Excellent! Thank you for the update.
Take care,
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights