The Simple HTTP component enables the user to get content from an external HTTP Server (Web Server). The component directly accepts the certificates. If the Content element is present in the input message, then Post method is used else Get method is used.

Figure 1: Sample SimpleHTTP configuration
When accessing https URLs, this property determines whether the server certificates should be accepted or not
yes - Use this option if the server certificate should be accepted without any validation.
no - Use this option if server certificate should not be accepted. An exception is sent to ON_EXCEPTION port.
yes - Use this option to accept the certificate even if hostname in the certificate does not match with the hostname in the request URL.
no - If hostname in the certificate does not match with the hostname in the request URL, exception is thrown.
yes - Closes all the resources after processing each input request. If we select yes, the connections will not be cached.
no - Connections will be cached based on the "CacheConection" attribute in the input. If "no" is set to this property, then an attribute "CacheConnection" appears in the element "URL" of input port schema.
This option specifies the threshold limit, that is the maximum number of connections that can be stored in the cache. '-1' is the default value, which means connections are not removed from the cache. Any other positive integer can be specified to limit the number of connections stored. In this case 'Connection Removal Criteria' option will be visible.
![]()
Figure 2: Connection Removal Criteria
This option specifies the criteria to remove connections from the cache if the threshold limit exceeds.
Least recently added - The oldest entry in the cache is removed.
Least recently accessed - The entry that has been in the cache for the longest time without being accessed.
Configuration shown in the Figure 2 can be tested within the CPS by clicking on Test button.

Figure 3: Sample SimpleHTTP input message

Figure 4: Sample SimpleHTTP output message

Figure 5: Input Port Schema Structure
|
Schema Element |
Description |
|
|
<URL> |
URL from which content has to be fetched. If we set "Cleanup resources after each document" property to "no", then the attribute "CacheConnection" appears in this element (as shown in Figure 5). This attribute accepts two values "true" and "false". If "true" is set to "CacheConnection" attribute, then the connections created are cached and the these cached connections will be used when required. If we set "CacheConnection" attribute to "false", then the component clears the connection after each request. |
|
|
<Content> |
Content to be posted (optional) |
|
This scenario demonstrates a sending simple HTTP request to a server.
Configure the SimpleHTTP as described in Configuration and Testing section and use Feeder and Display component to send sample input and check the response respectively.

Figure 6: Demonstrating Scenario 1 with sample input and output
Sample Input
<ns1:HTTPRequest xmlns:ns1="http://www.fiorano.com/fesb/activity/SimpleHTTP1">
<URL>http://www.google.co.in/advanced_search?hl=en</URL>
</ns1:HTTPRequest>
Sample Output

Figure 7: HTML display of Output in Display Component.
The scenario demonstrates how a SimpleHTTP component can be used to post some data onto a Web Server hosted by a HTTPReceive component. The HTTPReceive component is hosting on port 9999 on the localhost machine and is configured to receive post data as simple text and send it back to the client as simple text.

Figure 8: Demonstrates using SimpleHTTP component to post data
Configure the SimpleHTTP as described in Configuration and Testing section and use Feeder and Display component to send sample input given below.
Sample Input
<ns1:HTTPRequest xmlns:ns1="http://www.fiorano.com/fesb/activity/SimpleHTTP1">
<URL>http://localhost:9999/index.html</URL>
<Content>Sample Content</Content>
</ns1:HTTPRequest>
Sample Output
Sample Content
For providing header properties like Content-Type or Content-Length, set the required properties in the input message with a prefix http_. For example, http_Content-Type.
For providing parameters, set the required properties in the input message as properties with a prefix param_. For example, param_myproperty.
To Post data we need to provide the header property Content-Type by setting property "http_Content-Type" to appropriate value on the input message. For example if we need to post simple text content then set the property "http_Content-Type" to "text/plain".
When connecting to secured sites, the component accesses truststore from different locations in different launch modes -
Separate Process - %JAVA_HOME%\jre\lib\security\cacerts
In-memory - %FIORANO_HOME%\esb\server\profiles\certs\jssecacerts
'jssecacerts' in %FIORANO_HOME% does not have trusted certificates required by most of the secured sites. Hence, to connect to secured sites when component is launched in-memory, either the trusted certificates should be added to 'jssecacerts' or the property 'javax.net.ssl.trustStore' (in %FIORANO_HOME%\esb\server\bin\server.conf, if FPS is launched using server.bat/server.sh and %FIORANO_HOME%\esb\fps\bin\fps.conf, if FPS is launched using fps.bat/fps.sh) should be set to %JAVA_HOME%\jre\lib\security\cacerts.