(from email)
Patrick:Thank you for replying to my InfoPathDev.com forum question (http://www.infopathdev.com/forums/t/15495.aspx). I followed your advice, took a closer look at my DataContract, and was able to get InfoPath to recognize the data structure coming from the WCF service. I actually changed the WCF service to return a custom object, instead of an XMLElement object.I have a quick follow-up. I would like to have InfoPath provide the WCF input parameter dynamically, based on the value in a form field. For example, user clicks on "Fetch Data" button, the button's rules query the data, dynamically using the value in a field as the WCF's input parameter, get the data back and automatically populate some other form fields. Basically, this is designed to validate that the user typed in a valid employee id. I tried entering the XPath from the field (/my:myFields/my:empID) for the parameter value using the InfoPath Data Connection Wizard, but had no luck.Is there a way to do this without using a codebehind? I am comfortable coding if I have to, but I would like to be able to minimize custom coding for this project.Thanks,Mack
======================
Hey Mack247,
Assuming your data connection is a Web Service type, you should be able to bind the input parameter to a field in your main data source. In the rule that you are using to "Fetch" set the field with the value from the xpath before calling the WCF service query. That should do it.