CallOptions
特定のクライアントで使用する必要があるオプションを指定します。このヘッダーは、Partner WSDL で使用する場合にのみ有効です。
API コール
defaultNamespace 要素は、create()、merge()、queryAll()、query()、queryMore()、retrieve()、search()、update()、および upsert() のコールをサポートしています。
client 要素は、上記すべてのコールと login()、delete()、describeGlobal()、describeLayout()、describeTabs()、describeSObject()、describeSObjects()、getDeleted()、getUpdated()、process()、undelete()、getServerTimestamp()、getUserInfo()、setPassword()、および resetPassword() のコールをサポートしています。
項目
サンプルコード — C#
このサンプルでは、CallOptions ヘッダーの使用方法を示します。クライアント ID および開発者の名前空間プレフィックスを設定します。これは管理パッケージで項目名を解決するために使用します。次に、指定したユーザーをログインします。
1public void CallOptionsSample()
2{
3 // Web Reference to the imported Partner WSDL.
4 APISamples.partner.SforceService partnerBinding;
5
6 string username = "USERNAME";
7 string password = "PASSWORD";
8
9 // The real Client ID will be an API Token provided by Salesforce
10 // to partner applications following a security review.
11 // For more details, see the Security Review FAQ in the online help.
12 string clientId = "SampleCaseSensitiveToken/100";
13
14 partnerBinding = new SforceService();
15 partnerBinding.CallOptionsValue = new CallOptions();
16 partnerBinding.CallOptionsValue.client = clientId;
17
18 // Optionally, if a developer namespace prefix has been registered for
19 // your Developer Edition organization, it may also be specified.
20 string prefix = "battle";
21 partnerBinding.CallOptionsValue.defaultNamespace = prefix;
22
23 try
24 {
25 APISamples.partner.LoginResult lr =
26 partnerBinding.login(username, password);
27 }
28 catch (SoapException e)
29 {
30 Console.WriteLine(e.Code);
31 Console.WriteLine(e.Message);
32 }
33}