HTTP Client Adapter

The HTTP Client adapter sends HTTP requests to trading partners by using a perimeter server. The HTTP Client adapter replaces the B2B HTTP Client adapter and the HTTP Send adapter.

The following table provides an overview of the HTTP Client adapter:

System name HTTP Client Adapter
Graphical Process Modeler (GPM) category None
Description Sends HTTP requests to trading partners using a Perimeter server. The HTTP Client adapter replaces the B2B HTTP Client adapter and the HTTP Send adapter, which is being retired. The HTTP Client adapter and its related services provide all the functionality of the former two adapters plus the following enhancements:
  • Use Perimeter services
  • Highly scalable (>150 concurrent transfers)
  • Supports large files up to 2 GB
  • Supports HTTP 1.1
Business usage Use this adapter to send documents to a trading partner using HTTP.
Usage example The Sterling B2B Integrator business process must send a message to a trading partner and the trading partner's profile specifies HTTP as the transport protocol. The business process passes the document as well as information about the trading partner to the HTTP Client adapter. Using the information provided in the business process, the HTTP Client adapter connects to the trading partner and transfers the document, enforcing any security specifications from the business process.
Preconfigured? No
Requires third-party files? No
Platform availability All supported Sterling B2B Integrator platforms
Related services Related services:
  • HTTP Client Begin Session Service
  • HTTP Client End Session Service
  • HTTP Client GET Service
  • HTTP Client Method Service
  • HTTP Client POST Service
Application requirements An HTTP server is required at the external trading partner location. When this adapter is configured with a non-local-mode Perimeter server, the Perimeter server must be installed and running. This Perimeter server is typically installed in a DMZ environment, separated from Sterling B2B Integrator by a firewall.
Initiates business processes? No
Invocation The HTTP Client adapter is invoked from one of the HTTP Client services used within a business process.
Business process context considerations Business processes using HTTP client services should not be marked as Auto Resume. These services require an established session which will no longer exist after a restart.
Returned status values Returned status values:
  • 100s – Informational parameters and more status parameters will follow.
  • 200s – Request was OK.
  • 300s – Request failed and more status codes will follow.
  • 400s – Client Request Failed. This is a client error.
  • 500s – Server failed to handle a valid request. This is a server error.
Note: For information on setting the SOAP fault status to return 500 HTTP error status, see SOAP Outbound service.
Restrictions All work bound within an HTTP Client Begin Session service and an HTTP Client End Session service must be within the same business process.
Persistence level N/A
Testing considerations To test this adapter, run the HTTPClientDemoAllServices business process and verify that it completes successfully. For more information about the HTTPClientDemoAllServices business process, see the Business Process Example. Debug information related to this adapter can be found in the HTTP Client Adapter and Services log.

Implementing the HTTP Client Adapter

To implement the HTTP Client adapter, complete the following tasks:
  1. Create an HTTP Client adapter configuration. For information, see Managing Services and Adapters.
  2. Configure the HTTP Client adapter. For information, see Configuring the HTTP Client Adapter.

Configuring the HTTP Client Adapter

To configure the HTTP Client adapter, you must specify field settings in Sterling B2B Integrator:

Field Description
Name Unique and meaningful name for the adapter configuration. Required.
Description Meaningful description for the adapter configuration, for reference purposes. Required.
Select a Group Select one of the options:
  • None – You do not want to include this configuration in a group at this time.
  • Create New Group – You can enter a name for a new group in this field, which will then be created along with this configuration.
  • Select Group – If you have already created one or more groups for this adapter type, they are displayed in the list. Select a group from the list.
Note: For more information about groups, see Managing Services and Adapters.
Perimeter Server Name List of Perimeter servers, including local-mode Perimeter servers. Required.
Local port range Ranges or lists of local ports to restrict the adapter to. For example, 123-456 or 123,124,999.
Global Proxy Server Available Global Proxy Servers. Select a global proxy server to enable all adapters to share a common proxy configuration. You can configure changes to all the proxy servers globally instead of modifying each adapter instance. For additional information on global proxy server, see Global Proxy Server Setting.
Note: If you have enabled both Use proxy server and Global Proxy Server parameters with specific proxy settings, the value entered for the Use proxy server parameter overrides the setting in the Global Proxy Server.
Number of connection retries Number of times the HTTP Client adapter will try to connect to the server. Required. Valid value is any integer between 0 and 50. Default is 3.
Delay between retries (second) Number of seconds the HTTP Client adapter will wait between retry attempts. Required. Valid value is any integer between 1 and 7200. Default is 20.
Response timeout (second) Number of seconds it should take for the server to respond. Required. Valid value is any integer between 1 and 999999. Default is 60.
Use proxy server Whether to use an HTTP proxy server. Required. Valid values:
  • Yes – A proxy server will be used
  • No – No proxy server will be used
Proxy hostname IP address or host name of the proxy server to use. Required if Use proxy server is set to Yes. This parameter can be overridden by a Trading Partner profile setting.
Proxy port Port number of the proxy server. Required if Use proxy server is set to Yes. This parameter can be overridden by a Trading Partner profile setting.
Proxy retry attempts Number of times the HTTP Client adapter will try to connect to the proxy server. Required if Use proxy server is set to Yes. Valid values: any integer between 0 and 50. Default is 3. This parameter can be overridden by a Trading Partner profile setting.
Use Proxy Basic Authentication Whether the proxy server requires basic authentication. Required if Use proxy server is set to Yes. Valid values:
  • Yes – Proxy basic authentication will be used
  • No – Proxy basic authentication will not be used
Proxy username User name to use with the proxy server. Required if Use Proxy Basic Authentication is set to Yes.
Proxy password Password for the Proxy username. Required if User Proxy Basic Authentication is set to Yes.

Business Process Example

The following example business process illustrates the use of the HTTP Client services, which work through the HTTP Client adapter:

The associated BPML code is shown below:

 <process name="HTTPClientDemoAllServices">
  <sequence>
    <!-- Get obscured password -->
    <operation name="Obscure Password">
      <participant name="HTTPClientObscureParameter"/>
      <output message="outmsg">
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="HTTPClientObscureResults" from="*"></assign>
      </input>
    </operation>
     <!-- HTTP Client Begin Session service-->
     <!-- Create connection to specified host and port -->
    <operation name="HTTP Client Begin Session Service">
      <participant name="HTTPClientBeginSession"/>
      <output message="HTTPClientBeginSessionServiceTypeInputMessage">
        <assign to="HTTPClientAdapter">HTTPClientAdapter</assign>
        <assign to="RemoteHost">httpserver</assign>
        <assign to="RemotePort">12345</assign>
        <!-- If server requires Basic authentication -->
        <assign to="RemoteUserId">userid</assign>
        <assign to="RemotePasswd"  from="HTTPClientObscureResults/admin/text()"></assign> 
            RemoteUserId and RemotePasswd are not needed if using a 
            trading partner profile. The profile will supply this information.
        <!-- To use a Trading Partner profile -->
        <assign to="ProfileId">someExistingProfileId</assign>
        <!-- To override HTTPClientAdapter configuration settings -->
        <assign to="ConnectionRetries">10</assign>
        <assign to="RetryDelay">1</assign>
         <!-- If server requires SSL authentication -->
        <assign to="SSL">Must</assign>
        <assign to="CipherStrength">Strong</assign>
        <assign to="CACertificateId">SomeHttp-Id</assign>
        <assign to="SystemCertificateId">httpsampleclientcert1-Id</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="HTTPClientBeginSessionServiceResults" from="*"></assign>
      </input> 
</operation>
     <!-- HTTP Client Method Service -->
    <operation name="HTTP Client Method Service">
      <participant name="HTTPClientMethod"/>
      <output message="HTTPClientMethodServiceTypeInputMessage">
        <assign to="SessionToken"  from="HTTPClientBeginSessionServiceResults/
             SessionToken/text()"></assign>
        <assign to="MethodType">HEAD</assign>
        <assign to="URI">/hello</assign>
        <assign to="RawResponse">true</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="HTTPClientMethodServiceResults" from="*" append="true"/>
      </input>
    </operation>
    <!-- HTTP Client POST Service -->
    <operation name="HTTP Client Post Service">
      <participant name="HTTPClientPost"/>
      <output message="HTTPClientPostServiceTypeInputMessage">
        <assign to="SessionToken" from="HTTPClientBeginSessionServiceResults/
             SessionToken/text()"></assign>
        <assign to="URI">/hello</assign>
        <assign to="RawResponse">false</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="HTTPClientPostServiceResults" from="*" append="true"/>
      </input>
    </operation>
    <!-- HTTP Client GET Service -->
    <operation name="HTTP Client Get Service">
      <participant name="HTTPClientGet"/>
      <output message="HTTPClientGetServiceTypeInputMessage">
        <assign to="SessionToken"  from="HTTPClientBeginSessionServiceResults/
               SessionToken/text()"></assign>
        <assign to="URI">/someURI/</assign>
        <assign to="ResponseTimeout">120</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="HTTPClientGetServiceResults" from="*" append="true"/>
      </input>
    </operation>
     <!-- HTTP Client End Session Service -->
     <!-- Ends session specified by SessionToken -->
    <operation name="HTTP Client End Session Service">
      <participant name="HTTPClientEndSession"/>
      <output message="HTTPClientEndSessionServiceTypeInputMessage">
        <assign to="SessionToken" from="HTTPClientBeginSessionServiceResults/
               SessionToken/text()"></assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="HTTPClientEndSessionServiceResults" from="*" append="true"/>
      </input>
    </operation>
  <!-- Provides error handling -->
  <onFault>
    <sequence name="End Session">
    <operation name="HTTP Client End Session Service">
      <participant name="HTTPClientEndSession"/>
      <output message="HTTPClientEndSessionServiceTypeInputMessage">
        <assign to="SessionToken"  from="HTTPClientBeginSessionServiceResults/
               SessionToken/text()"></assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="HTTPClientEndSessionServiceResults" from="*"></assign>
      </input>
    </operation>
    </sequence>
   </onFault>
  </sequence> 
</process>