WebServiceAdapterObject Interface (Microsoft.Office.Interop.InfoPath.SemiTrust)
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in microsoft.office.interop.infopath.semitrust.dll)
This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, see WebServiceAdapter2.
The WebServiceAdapterObject object is a type of Microsoft Office InfoPath 2007 data adapter that contains all the information necessary for retrieving data from and submitting data to an external data source.
The WebServiceAdapterObject provides properties that can be used to get and set information about the data adapter's input and operation strings. It also provides a property for getting the Uniform Resource Locator (URL) of the Web Services Description Language (WSDL) file of the XML Web service.
For secondary data sources, the WebServiceAdapterObject object is accessible through the QueryAdapter property of the DataSourceObject object and the Item property of the DataAdaptersCollection. Data objects are accessible through the DataObjects property of the XDocument object.
If a Web service is used as the primary data source for a form, the WebServiceAdapterObject object is accessible through QueryAdapter property of the XDocument object
In the following example, a reference to the WebServiceAdapter object is set by using the QueryAdapter property of the DataSourceObject object by passing the name of the DataSourceObject object to the Item property of the DataObjectsCollection collection:
WebServiceAdapter2 wsAdapter2; wsAdapter2 = (WebServiceAdapter2) thisXDocument.DataObjects["WebCityList"].QueryAdapter;
After the reference has been set, you can use the properties of the WebServiceAdapter object as shown in the following example, which sets a reference to the string returned by the Input property:
In this case, the QueryAdapter property was used to access the Input property of the WebServiceAdapter object.