IBM Support

Using the cwservice.exe program to manage adapter services for Windows

Troubleshooting


Problem

When creating or deleting services to start and stop your WebSphere Business Integration Adapters, there are a number of options which must be configured. This note provides complete documentation for managing your Windows services to start and stop adapters.

Resolving The Problem

The program used by the WebSphere Business Integration Adapters to manage services is cwservice.exe, which can be found in the %WBIA_Home%\bin directory in Windows. It is a command line tool, and is used to create and delete Windows services. Typing "cwservice" without parameters prints the following usage guide to your command console.


Usage: CwService [-parameters]
Required:
-x{i, r, c}
-mode={Auto|Manual}
-c<Full path to the batch file to be executed>
-t<SERVER|CONNECTOR|SNMPAGENT|NAMESERVER>
InterChange:
-s<ServiceName>
-p<PortNumber>
Snmpagent:
-s<ServiceName>
-p<PortNumber>
Connectors:
-s<ServiceName>
-p<PortNumber>
-i<Interchange Server this connector will connect to>
-t<Threadingmodel> where Threadingmodel is {MULTI_THREADED|SINGLE_THREAD
ED}
Name Server:
-s<ServiceName>
Optional:
-z<comma-separated list of services this service depends upon>

For WebSphere Business Integration Adapters, the relevant configuration options are in the "Required" section and in the "Connectors" section.

To Create a Windows Service:

1) Edit your connector startup script to run without parameters. This means opening your %WBIA_HOME%\connectors\%Connector_Name%\start_%Connector_Name%.bat file, and replacing %1 with the connector name, and %2 with the broker name.


2) Set a variable called AGENTPORT in your connector startup service file as shown. Give a port number other than the one assigned to ICS & any other adapters (each adapter must use unique port). By default ICS uses port # 55500.

==
set AGENTPORT=55501

%WBIA_Home%\bin\start_adapter.bat -n%CONNAME%Connector -s%SERVER% -l%CONNPACKAGENAME% -z%AGENTPORT% %3 %4 %5

==

3) Type the following command in the command line to create a manually initiated service:

cwservice -xi -mode=Manual -tCONNECTOR -c%WBIA_HOME%\connectors\%Connector_Name%\start_%Connector_Name%.bat -s%Connector_Name%Connector -i%broker_name% -p55501

Type the following command in the command line to create an automatically initiated service:

cwservice -xi -mode=Automatic -tCONNECTOR -c%WBIA_HOME%\connectors\%Connector_Name%\start_%Connector_Name%.bat -s%Connector_Name%Connector -i%broker_name% -p55501

4) Reboot Windows to register service.

To Delete a Windows Service:

1) Type the following in the command line:

cwservice -xr -s%Connector_Name%Connector

2) Reboot Windows to complete service deletion.

[{"Product":{"code":"SSMKUK","label":"WebSphere Adapters Family"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Adapter \u2013 Non-specific","Platform":[{"code":"PF033","label":"Windows"}],"Version":"2.6","Edition":"WBI","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
15 June 2018

UID

swg21243334