Socket Client Adapter

The Socket Client adapter sends TCP requests to trading partners by using the perimeter service.

Socket Client Adapter Overview

The Socket Client adapter allows you to connect to a remote Transmission Control Protocol (TCP) endpoint using the Socket Connect service. You can perform read, write, and close operations over the socket using the Socket Read service, Socket Write service, and Socket Close service respectively.

Socket Connect Service

Socket Connect service allows users to connect to the remote TCP endpoint, and options are provided to enable a Secure Sockets Layer (SSL) connection as well.

A few important parameters are explained below:
RemoteHost
The machine on which the remote TCP Server is running.
RemotePort
The port on which the remote TCP Server is listening.
SocketClientAdapter
The Socket Client adapter instance that is used to connect to the remote end point.

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

System name Socket Client Adapter
Graphical Process Modeler (GPM) categories Not in the GPM.
Description This adapter sends TCP requests to trading partners using the Perimeter service.
Business usage A business user uses this adapter to send TCP requests to trading partners using the Perimeter service.
Usage example A Sterling B2B Integrator business process is executed to translate a document that must be sent to a trading partner. After the translation, Sterling B2B Integrator uses an instance of the Socket Client adapter in the Socket Connect service to establish a session with the trading partner's TCP server.
Preconfigured? No
Requires third-party files? No
Platform availability All supported Sterling B2B Integrator platforms.
Related services Related services:
  • Socket Connect service
  • Socket Read service
  • Socket Write service
  • Socket Close service
  • Socket Server adapter
Application requirements A TCP server at the external trading partner's location is required. Information about this TCP server must be configured in the Socket Connect service. 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 nonsecure (DMZ) environment, separated from Sterling B2B Integrator by a firewall. For more information on installing and running that component, see Perimeter Services.
Initiates business processes? No
Invocation This adapter is invoked from the Socket Connect service within a business process.
Business process context considerations A business process using the Socket Client adapter should not be configured to automatically resume. The Socket Client adapter requires an established session which will not exist if the business process is set to automatically resume.
Returned status values Returned status values:
  • 0 - Success
  • 1 - Error
Restrictions None
Persistence level System Default
Testing considerations The debug information for this adapter can be found in the Socket Client adapter and Socket Connect service log files.

Configuring the Socket Client Adapter

To configure the Socket Client adapter, you must specify field settings in the user interface service configuration:

Field Description
Name Name for the service in Sterling B2B Integrator. Required.
Description Description of the service. Required.
Select a Group Selection or creation of the group for this service. Optional.
Perimeter Server Selection of a local-mode perimeter server for this service. Entries in this list are created in a separate user interface. For more information see Perimeter Services. Required.
Min Threads Tuning parameter that indicates the range of threads available for handling events to improve performance. This parameter must be less than or equal to the Max Threads value. For more information see the Performance and Tuning Guide. Required.
Max Threads Tuning parameter that indicates the range of threads available for handling events to improve performance. This parameter must be greater than or equal to the Min Threads value. For more information see the Performance and Tuning Guide. Required.
Transfer Buffer Size Buffer size to be used for data transfer. This indicates the number of bytes to be read or written from each socket. Required.
Character Encoding Character encoding that must be used to interpret the data that is sent so it can be put into the process data. Optional.

Socket Client Business Process

The Socket Client business process is comprised of the Socket Connect service followed by the Socket Read service, Socket Write service, and Socket Close service. If the business process is halted at the Socket Read service, Socket Write service, or Socket Close service, the business process cannot be resumed. In this scenario, you will need to restart the business process from the Socket Connect service by establishing a new session.

Sample Client Business Process

<process name="RSocketC">
  <sequence>
    <operation name="SocketClientConnectServiceType">
      <participant name="SCS1"/>
      <output message="SocketClientConnectServiceTypeInputMessage">
        <assign to="." from="*"></assign>
        <assign to="CACertificateId">blrgislin04:node1:131287d66fb:546</assign>
        <assign to="CipherStrength">STRONG</assign>
        <assign to="RemoteHost">localhost</assign>
        <assign to="RemotePort">10024</assign>
        <assign to="SocketClientAdapter">a</assign>
        <assign to="SSL">true</assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
        <assign to="ClientSessionInfo" from="*"></assign>
      </input>
    </operation>

    <operation name="Socket Read Service">
      <participant name="SRS"/>
      <output message="SocketReadServiceTypeInputMessage">
        <assign to="BytesCount">15</assign>
      <assign to="DataNode">testNode</assign>
        <assign to="SessionToken" from="ClientSessionInfo/SessionToken/text()"></assign>
		<assign to="DelayWaitingOnIO">30</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>

    <operation name="Socket Write Service">
      <participant name="SWS"/>
      <output message="SocketWriteServiceTypeInputMessage">
        <assign to="SessionToken" from="ClientSessionInfo/SessionToken/text()"></assign>
		<assign to="DelayWaitingOnIO">20</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>

<operation name="SocketCloseServiceType">
      <participant name="SClose1"/>
      <output message="SocketCloseServiceTypeInputMessage">
 <assign to="SessionToken" from="ClientSessionInfo/SessionToken/text()"></assign>
       <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
</sequence>
</process>