WebServiceAdapterObject Interface
Represents a connection to an XML Web service.
Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)
Syntax
'Declaration
<GuidAttribute("096cd5d4-0786-11d1-95fa-0080c78ee3bb")> _
Public Interface WebServiceAdapterObject _
Inherits WebServiceAdapter2, WebServiceAdapter
'Usage
Dim instance As WebServiceAdapterObject
[GuidAttribute("096cd5d4-0786-11d1-95fa-0080c78ee3bb")]
public interface WebServiceAdapterObject : WebServiceAdapter2,
WebServiceAdapter
Remarks
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, seeWebServiceAdapter2.
The WebServiceAdapterObject object is a type of Microsoft InfoPath 2010 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
Examples
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:
string input;
input = wsAdapter2.Input;
Note
In this case, the QueryAdapter property was used to access the Input property of the WebServiceAdapter object.