WebServiceAdapter2.Input Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the XML string ('outer XML') corresponding to the input element in the form definition (.xsf) file.
public:
property System::String ^ Input { System::String ^ get(); void set(System::String ^ value); };
public string Input { get; set; }
member this.Input : string with get, set
Public Property Input As String
Property Value
Implements
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.<span class="label">Input</span>);
// 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;
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.