Newer Version Available
RemoteSiteSetting
Represents a remote site setting. Before any Visualforce page, Apex callout, or JavaScript code using XmlHttpRequest in an s-control or custom button can call an external site, that site must be registered in the Remote Site Settings page, or the call will fail. RemoteSiteSetting extends the Metadata metadata type and inherits its fullName field.
Declarative Metadata File Suffix and Directory Location
RemoteSiteSetting components are stored in the remoteSiteSettings directory of the corresponding package directory. The file name matches the unique name of the remote site setting, and the extension is .remoteSite.
Version
RemoteSiteSetting components are available in API version 19.0 and later.
Fields
| Field | Field Type | Description |
|---|---|---|
| description | string | The description explaining what this remote site setting is used for. |
| disableProtocolSecurity | boolean | Required. Indicates whether code within Salesforce can access the remote site regardless of whether the user's connection is over HTTP or HTTPS (true) or not (false). When true, code within Salesforce can pass data from an HTTPS session to an HTTP session, and vice versa. |
| fullName | string |
The
name can only contain characters, letters, and the underscore (_)
character, must start with a letter, and cannot end with an underscore
or contain two consecutive underscore characters. Inherited from the Metadata component, this field is not defined in the WSDL for this component. It must be specified when creating, updating, or deleting. See create() to see an example of this field specified for a call. |
| isActive | boolean | Required. Indicates if the remote site setting is active (true) or not (false). |
| url | string | Required. The URL for the remote site. |
Declarative Metadata Sample Definition
A sample XML definition of a remote site setting is shown below.
1<?xml version="1.0" encoding="UTF-8"?>
2<RemoteSiteSetting xmlns="http://soap.sforce.com/2006/04/metadata">
3 <description>Used for Apex callout to mapping web service</description>
4 <disableProtocolSecurity>false</disableProtocolSecurity>
5 <isActive>true</isActive>
6 <url>https://www.maptestsite.net/mapping1</url>
7</RemoteSiteSetting>