The code below describe how to query and read the result of a
webervice(Datasource) with Infopath
//Request information from the webservice
DataObject
doConnection=thisXDocument.DataObjects[''DataConnectionName''];
//Fill parameter
doConnection.DOM.selectSingleNode(''//*[local-name()='param1']'').text =
param1;
//Send the query
doGroup.Query();