次の方法で共有


WebServiceAdapter2.Input プロパティ

定義

フォーム定義 (.xsf) ファイル内の input 要素に対応する XML 文字列 ('外部 XML') を取得または設定します。

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

プロパティ値

実装

次の例では、 の WebServiceAdapterObjectInput プロパティが一時 XML DOM に読み込まれ、メッセージ ボックスに表示されます。 次に、フォーム テンプレートの一部である "NewSource.xml" というリソース ファイルから新しい XML ノードを一時 DOM に読み込みます。 その後、Input プロパティを更新された一時 DOM に設定すると、WebServiceAdapter が 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;

注釈

データの送信に使用される Web サービス アダプターの場合、フォーム定義 (.xsf) ファイルの 入力 要素には、 partFragment 要素によって指定されたセカンダリ データ ソースの部分に関する情報が含まれます。これは、メソッド操作用 Submit() に呼び出される Web メソッドにパラメーターとして提供されます。

: の Input プロパティ WebServiceAdapterObject は、セカンダリ データ ソースで使用できます。 Web サービスにクエリする場合、queryFields グループは WebServiceAdapter への入力として機能するため、メイン データ ソースの Input プロパティは常に空文字列を返します。

適用対象