var nodes=XDocument.DOM.selectNodes("/my:myFields/my:R_group/my:RT_directreports") //feth all records for (var i=0; itnxs for the tips Greg.
after a long and tedious trial and error, i worked it out.
2 errors i made
a) webs.selectSingleNode("/dfs:myFields/dfs:queryFields/tns:Landesk_list/tns:StrUser").text=Strname was the correct one, i was missing a 'tns'. I exported the infopath form locally and looked into the forms for the service setup to get that info.
b) I needed to query the Adapter, not the DOM.
I recreated the webservice onto a different virtual directory to cut out the Oracle namespace i was carrying along on my webservices. It was pointing to a SQL server anyway. so the namespace changed to ns2 instead of tns
In case it helps anyway struggeling. here's the code i used
--------------------------------------------------------------------------
var nodes=XDocument.DOM.selectNodes("/my:myFields/my:R_group/my:RT_directreports") //fetch all records from the repeating table in infopath
for (var i=0; i<nodes.length;i++) //and start looping
{
var machina = nodes(i).selectSingleNode("my:F_Currentmach").text;
if (machina == "n.a.")
{
var Strname = nodes(i).selectSingleNode("my:F_Firstname").text+"."+nodes(i).selectSingleNode("my:F_Lastname").text; // i want to hunt for machines logged on by "firstname.lastname"
var websobj=XDocument.DataObjects["list_machines"] ; //list_machines is the name of my secondary data service
websDOM=websobj.DOM
websDOM.setProperty("SelectionNamespaces",'xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:ns2="http://tempuri.org/"');
var oUser=websDOM.selectSingleNode("/dfs:myFields/dfs:queryFields/ns2:Landesk_list/ns2:StrUser"); //this is my input parameter
oUser.text=Strname
var Adapter= XDocument.DataObjects["list_machines"].QueryAdapter;
Adapter.Query(); //fire off the query to the webservice
XDocument.GetDOM("list_machines").setProperty("SelectionNamespaces",'xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:ns2="http://tempuri.org/"');
var nodes2=XDocument.GetDOM("list_machines").selectNodes("/dfs:myFields/dfs:dataFields/ns2:Landesk_listResponse/ns2:Landesk_listResult/NewDataSet/Table"); //read all nodes returned by the webservice
var allmachines=""
for (var j=0; j<nodes2.length;j++)
{
var machines=nodes2(j).selectSingleNode("Make").text+" "+nodes2(j).selectSingleNode("model").text
allmachines=allmachines +" "+machines
}
nodes(i).selectSingleNode("my:F_Currentmach").text=allmachines
}
}
In case you're wondering what i was trying to do..
step A is to fetch machineinfo for a selected user from a secondary webservice.
step B is to attempt to locate machine for those who're not recorded by lookign to the the log in info on a differnt server (the 'no data available')
based on machine, the age is set and based on that age, one or more checkboxes get hidden (no upgrade possible)

tnxs for your willingness to help Greg
Gee, i start to like the coding now..
K