# CallOptions

Specifies the options needed to work with a specific client. This header is only available for use with the [Partner WSDL](/docs/platform/api/guide/sforce-api-partner.md).

## API Calls

The `defaultNamespace` element supports the following calls: [create()](/docs/platform/api/guide/sforce-api-calls-create.md), [merge()](/docs/platform/api/guide/sforce-api-calls-merge.md), [`queryAll()`](/docs/platform/api/guide/sforce-api-calls-queryall.md), [`query()`](/docs/platform/api/guide/sforce-api-calls-query.md), [`queryMore()`](/docs/platform/api/guide/sforce-api-calls-querymore.md), [`retrieve()`](/docs/platform/api/guide/sforce-api-calls-retrieve.md), [`search()`](/docs/platform/api/guide/sforce-api-calls-search.md), [update()](/docs/platform/api/guide/sforce-api-calls-update.md), and [upsert()](/docs/platform/api/guide/sforce-api-calls-upsert.md).

The `client` element supports all of the above calls, plus the following: convertLead(), [`login()`](/docs/platform/api/guide/sforce-api-calls-login.md), [`delete()`](/docs/platform/api/guide/sforce-api-calls-delete.md), [`describeGlobal()`](/docs/platform/api/guide/sforce-api-calls-describeglobal.md), [`describeLayout()`](/docs/platform/api/guide/sforce-api-calls-describelayout.md), [`describeTabs()`](/docs/platform/api/guide/sforce-api-calls-describetabs.md), [`describeSObject()`](/docs/platform/api/guide/sforce-api-calls-describesobject.md), [`describeSObjects()`](/docs/platform/api/guide/sforce-api-calls-describesobjects.md), [`getDeleted()`](/docs/platform/api/guide/sforce-api-calls-getdeleted.md), [`getUpdated()`](/docs/platform/api/guide/sforce-api-calls-getupdated.md), [process()](/docs/platform/api/guide/sforce-api-calls-process.md), [undelete()](/docs/platform/api/guide/sforce-api-calls-undelete.md), [`getServerTimestamp()`](/docs/platform/api/guide/sforce-api-calls-getservertimestamp.md), [`getUserInfo()`](/docs/platform/api/guide/sforce-api-calls-getuserinfo.md), [`setPassword()`](/docs/platform/api/guide/sforce-api-calls-setpassword.md), and [`resetPassword()`](/docs/platform/api/guide/sforce-api-calls-resetpassword.md).

## Fields

### `client`

**Type:** string

**Description:** A string that identifies a client. If a valid name is not provided, the value 000000000009998 is used. Subsequent calls can override the existing client name.

### `defaultNamespace`

**Type:** string

**Description:** A string that identifies a developer namespace prefix. Use this field to resolve field names in managed packages without having to fully specify the `fieldName` everywhere. For example, if the developer namespace prefix is `battle`, and you have a custom field in your package called `botId`, you can set this header, and then queries such as the following will succeed:

```java
query("SELECT id, botId__c from Account");
```

In this case the actual field queried is the `battle__botId__c` field. Using this field allows you to write client code without having to specify the namespace prefix. Without this field specified, the full name of the field would have to be used for the query to succeed. In the example above, you would have to specify `battle__botId__c`. Note that if this field is set, and the query specifies the namespace as well, the response will not include the prefix. For example, if you set this header to `battle`, and issue a query like `query("SELECT id, battle__botId__c from Account");`, the response would use a `botId__c` element, not a `battle_botId__c` element. Describe calls ignore this header, so there will be no ambiguity between fields with namespace prefixes and customer fields of the same name without the prefix.

## Sample Code—C\#

This sample shows how to use the `CallOptions` header. It sets a client ID and a developer namespace prefix, which is used to resolve field names in managed packages. Next, the sample logs the specified user in.

```codesegment
public void CallOptionsSample()
{
    // Web Reference to the imported Partner WSDL.
    APISamples.partner.SforceService partnerBinding;
    
    string username = "USERNAME";
    string password = "PASSWORD";
    
    // The real Client ID will be an API Token provided by Salesforce
    // to partner applications following a security review.
    // For more details, see the Security Review FAQ in the online help.
    string clientId = "SampleCaseSensitiveToken/100";
    
    partnerBinding = new SforceService();
    partnerBinding.CallOptionsValue = new CallOptions();
    partnerBinding.CallOptionsValue.client = clientId;
    
    // Optionally, if a developer namespace prefix has been registered for
    // your Developer Edition organization, it may also be specified.
    string prefix = "battle";
    partnerBinding.CallOptionsValue.defaultNamespace = prefix;
    
    try
    {
        APISamples.partner.LoginResult lr =
            partnerBinding.login(username, password);
    }
    catch (SoapException e)
    {
        Console.WriteLine(e.Code);
        Console.WriteLine(e.Message);
    }
}
```
