WebServiceAdapter2.Input property

Gets or sets the XML string ('outer XML') corresponding to the input element in the form definition (.xsf) file.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
Property Input As String
    Get
    Set
'Usage
Dim instance As WebServiceAdapter2
Dim value As String

value = instance.Input

instance.Input = value
string Input { get; set; }

Property value

Type: System.String

Implements

WebServiceAdapter.Input

Remarks

In the case of a Web service adapter used to submit data, the input element of the form definition (.xsf) file contains information about the parts of the secondary data source, specified by the partFragment elements, that will be provided as parameters to the Web method that is invoked for the Submit method operation.

Note

The Input property of the WebServiceAdapterObject is available for secondary data sources. The Input property for a main data source always returns an empty string since the queryFields group serves as the input for the WebServiceAdapter when querying the Web service.

Important

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Examples

In the following example, the Input property of the WebServiceAdapterObject is loaded into a temporary XML DOM, then displayed in a message box. A new XML node is then loaded into the temporary DOM from a resource file, "NewSource.xml", which is part of the form template. The Input property is then set to the updated temporary DOM, which changes how the WebServiceAdapter will submit data to the Web service:

const string newSourceXmlFileName = "NewSource.xml";

// Get the Main Data Source WebServiceAdapter object
WebServiceAdapter2 webServiceAdapter = thisXDocument.DataAdapters[0] as WebServiceAdapter2;
if (webServiceAdapter == null)
{
 thisXDocument.UI.Alert("A secondary WebServiceAdapter does not exist.");
 return;
}

// Load the xsf:input element into an XML DOM
IXMLDOMDocument2 tempDom = thisXDocument.CreateDOM() as IXMLDOMDocument2;
if (tempDom == null)
{
 thisXDocument.UI.Alert("Could not create a temporary DOM.");
 return;
}
tempDom.validateOnParse = false;
tempDom.preserveWhiteSpace = false;
tempDom.loadXML(webServiceAdapter.Input);

// Get the source attribute from the xsf:Input element
IXMLDOMNode sourceAttribute = tempDom.documentElement.attributes.getNamedItem("source");

// Show the source attribute value of the xsf:input element before the change
thisXDocument.UI.Alert(sourceAttribute.text);

// Change the source file name
sourceAttribute.text = newSourceXmlFileName;

// Show the source after the change
thisXDocument.UI.Alert(sourceAttribute.text);

// Save the changes from the tempDom back to the Input property
webServiceAdapter.Input = tempDom.xml;

See also

Reference

WebServiceAdapter2 interface

WebServiceAdapter2 members

Input overload

Microsoft.Office.Interop.InfoPath.SemiTrust namespace