次の方法で共有


WebServiceAdapter2.Input プロパティ

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

このプロパティは、CLS に準拠していません。  

名前空間: Microsoft.Office.Interop.InfoPath.SemiTrust
アセンブリ: Microsoft.Office.Interop.InfoPath.SemiTrust (microsoft.office.interop.infopath.semitrust.dll 内)

構文

'宣言
<DispIdAttribute(7)> _
Property Input As String
'使用
Dim instance As WebServiceAdapter2
Dim value As String

value = instance.Input

instance.Input = value
[DispIdAttribute(7)] 
string Input { get; set; }

コメント

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

メモメモ :

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

メモ重要 :

このメンバは、現在開いているフォームと同じドメイン内で実行されているフォーム、またはドメインを越えたアクセス許可を付与されているフォームだけがアクセスできます。

次の例では、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.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;

関連項目

参照

WebServiceAdapter2 インターフェイス
WebServiceAdapter2 のメンバ
Microsoft.Office.Interop.InfoPath.SemiTrust 名前空間