Patrick:
I have looked at MSDN, numerous books, the SDK, online posts, etc. Nothing seemed to put it all together. Here is what I have (it may not be pretty, but it seems to be working ...)
This web service takes a value to identify which type of id is being requested and then returns a unique id.
I defined the web service as a secondary data source within Infopath. In setting up the secondary data source, I specified Query:Yes and Submit:No. I also set up the value to be passed to the web service as part of the secondary data source set up.
<code snippet>
//Get a reference to the data object
var objTicketDO = XDocument.DataObjects("GetTicketNumber");
//Load the data objects DOM into a new variable so we can
//set the SelectionNamespaces to be able to access/navigate the nodes
var objDOM = objTicketDO.DOM;
//Access the web service Adapter (the QueryAdapter seems to be where
//data is passed back and forth
var objWSAdapter = objTicketDO.QueryAdapter;
//Execute the query to call the web service and get the id
objTicketDO.Query();
//This seems to be the return value
//This may be due to the way the web service is set up that this works
var objOutputNode = objWSAdapter.OutputLocation;
var tOutput = objOutputNode.text;
//Set up the namespaces. Otherwise, you can't access the prefixes --
//you get an undeclared namespace prefix
//Looking at the secondary data source within Infopath
//(how it defined it) told me what to use
objDOM.setProperty("SelectionNamespaces",
'xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" ' +
'xmlns:tns="http://www.internalsite.com/TicketDB"');
//Fetch the response node
//Access the text or nodeTypedValue as needed
var oTicketResponse =
objDOM.selectSingleNode("/dfs:myFields/dfs:dataFields/tns:GetTicketNumberResponse/tns:GetTicketNumberResult");
//Some clean up
objTicketDO = null;
objDOM = null;
objWSAdapter = null;
This link did provide some help -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/xdobjWebServiceAdapter_HV01021251.asp
I hope others find this helpful ...
Regards,
TroyE