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 fails.

RemoteSiteSetting

Parent Type 

This type extends Metadata and inherits its fields.

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 

description 

  • Type: string
  • Required: No
  • Description: The description explaining what this remote site setting is used for.

disableProtocolSecurity 

  • Type: boolean

  • Required: Yes

  • Description: 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.

    Only set to true if you understand the security implications.

fullName 

  • Type: string

  • Required: No

  • Description: The name can only contain characters, letters, and the underscore (_) character. The name must start with a letter, and can’t end with an underscore or contain two consecutive underscore characters.

    Inherited from the Metadata component, this field isn’t 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 

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates if the remote site setting is active (true) or not (false).

url 

  • Type: string
  • Required: Yes
  • Description: Required. The URL for the remote site.

Declarative Metadata Sample Definition 

A sample XML definition of a remote site setting is shown in this code block.

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>