Compartir a través de


WebServiceAdapter2.Input Propiedad

Definición

Obtiene o establece la cadena XML ('XML externo') correspondiente al elemento input en el archivo de definición de formulario (.xsf).

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

Valor de propiedad

Implementaciones

Ejemplos

En el ejemplo siguiente, la propiedad Input de WebServiceAdapterObject se carga en un DOM XML temporal y, a continuación, se muestra en un cuadro de mensaje. Un nuevo nodo XML se carga entonces en el DOM temporal desde un archivo de recursos, "NewSource.xml", que es parte de la plantilla de formulario. La propiedad Input se establece, a continuación, para el DOM temporal actualizado, que cambia la forma en que WebServiceAdapter enviará los datos al servicio Web:

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;

Comentarios

En el caso de un adaptador de servicio web usado para enviar datos, el elemento de entrada del archivo de definición de formulario (.xsf) contiene información sobre las partes del origen de datos secundario, especificadas por los elementos partFragment , que se proporcionarán como parámetros al método web que se invoca para la operación de Submit() método.

Nota: La propiedad Input de WebServiceAdapterObject está disponible para orígenes de datos secundarios. La propiedad Input para un origen de datos principal siempre devuelve una cadena vacía, ya que el grupo queryFields sirve de entrada para WebServiceAdapter al consultar el servicio Web.

Se aplica a