webMethods Adapter
The webMethods adapter connects Sterling B2B Integrator to a webMethods® Enterprise server to publish events and to subscribe to events. Communication between the adapter and the server occurs across TCP/IP.
The following table provides an overview of the webMethods® adapter:
| Category | Description |
|---|---|
| System name | WebMethodsPublisher, WebMethodsSubscriber |
| Graphical Process Modeler (GPM) category | None |
| Description | Connects Sterling B2B Integrator to a webMethods® Enterprise server to publish events and to subscribe to events. Communication between the adapter and the server occurs across TCP/IP. |
| Preconfigured? | No |
| Required third-party files | client50.jar, libawssl50jn.so. See Installing the webMethods Adapter. |
| Platform availability | Sun Solaris |
| Related services | No |
| Application requirements | No |
| Initiates business processes? | Yes |
| Invocation | Runs as part of a business process. |
How the webMethods Adapter Works
The webMethods adapter has two parts and supports four basic operations.
Adapter Components
- webMethods Publisher adapter – The webMethods Publisher adapter enables business processes running in Sterling B2B Integrator to publish events to the webMethods Enterprise server. For more information about the webMethods Publisher adapter, see Implementing the webMethods Publisher Adapter.
- webMethods Subscriber adapter – The webMethods Subscriber adapter enables users of Sterling B2B Integrator to subscribe to webMethods events. After receiving an event from the webMethods Enterprise server, the webMethods Subscriber adapter starts a user-specified business process in Sterling B2B Integrator. For more information about the webMethods Subscriber adapter, see Implementing the webMethods Subscriber Adapter.
Basic Operations
- Synchronous request/response
- Runs a business process asynchronously
- Fire and forget
- Asynchronous with transactionality
These operations enable you to perform basic webMethods transactions. The following sections provide details.
Synchronous Request/Response Operation
The following figure shows the synchronous request/response operation for communicating with the webMethods Enterprise server. Only a webMethods Publisher adapter runs in this operation.

- The webMethods Publisher adapter translates the primary document from the business process into a webMethods event and publishes the event to the webMethods Enterprise server.
- The webMethods Publisher adapter waits for a reply event from the webMethods Enterprise server. If the adapter receives a reply event, it translates the webMethods event to an XML document and stores the document as the primary document of the business process. If the adapter does not receive a reply event within the timeout period, it reports the timeout period elapsed before the reply event was received.
Invoke Business Process Asynchronously Operation
The following figure shows starting a business process asynchronously to communicate with the webMethods Enterprise server. Only a webMethods Subscriber adapter runs in this operation.

- The webMethods Subscriber adapter receives an event to which it has subscribed from the webMethods Enterprise server.
- The webMethods Subscriber adapter checks its configuration data. If a business process is specified for the received event, the adapter starts that business process. If a business process is not specified for the event, the event is discarded.
Fire-and-Forget Operation
The following figure shows the fire-and-forget operation for communicating with the webMethods Enterprise server. Only a webMethods Publisher adapter runs in this operation.

- The webMethods Publisher adapter translates the primary document from the business process into a webMethods event and publishes the event to the webMethods Enterprise server.
- The webMethods Publisher adapter waits for an acknowledgment from the webMethods Enterprise server. If the adapter receives an acknowledgment within the timeout period, it reports in the status header of the business process that a subscriber received the event. Otherwise, the adapter reports that no subscriber received the event.
Asynchronous with Transactionality Operation
The asynchronous with transactionality operation runs both a webMethods Publisher adapter and a webMethods Subscriber adapter that connect to the same webMethods Enterprise server. Each transaction is associated with a unique transaction ID.
The following figure shows the asynchronous with transactionality operation:

- The XREF service persists a unique transaction ID as well as miscellaneous business process data in Sterling B2B Integrator.
- The webMethods Publisher adapter translates the primary document into a webMethods event, puts the transaction ID into the event envelope, and then publishes the event to the webMethods Enterprise server.
- The webMethods Subscriber adapter receives the event from the webMethods Enterprise server, parses the event body to an XML string, puts the string into the primary document, and gets the transaction ID and puts it in the process data.
- The DXREF service uses the transaction ID to read the business process data from the Sterling B2B Integrator database and puts it in the process data.
Structure of Input and Output Data
To publish an event to the webMethods Enterprise server, a webMethods Publisher adapter reads the primary document, which is an XML document, from the business process and translates the primary document to a webMethods event. When the webMethods Publisher adapter receives a reply event or the webMethods Subscriber adapter receives an event from the webMethods Enterprise server, the adapter translates that event to an XML document and sets that document as the primary document of the business process.
The following sections describe the translation between the webMethods event and the XML primary document. Find all the examples in the samples directory.
Basic Structure
The following sample XML document must be translated to an event and published to the webMethods Enterprise server:
<WebmethodsAdapter>
<event name="Sample::GetCustomerAllFields">
<customerId>14621</customerId>
<customerFirstName>Joe</customerFirstName>
<customerLastName>Smith</customerLastName>
</event>
</WebmethodsAdapter>The root element must always be WebmethodsAdapter.
The event information is wrapped in the event element, which has an attribute named name. The value of the name attribute is the event type name. The tag name for the event element and its name attribute varies depending on your locale. For more information about locale settings, see Internationalization.
The fields of the event element are its child elements. The element name is the field name, and the content text is the field value.
The following sample code shows the translation of the XML document to a webMethods event:
eventtype Sample::GetCustomerAllFields {
int customerId;
unicode_string customerFirstName;
unicode_string customerLastName;
}Structure Data Field
In a webMethods event, a structure data field is an event field with a user-defined type. It can contain simple data types, arrays, or other structures. When a structure data field is translated to an XML element, the structure name translates as the element tag, and the members of the structure data field translate as the child elements.
The following sample code shows a structure data field in a webMethods event:
eventtype Sample::GetCustomerAllFieldsStruct {
struct {
int customerId;
struct {
unicode_string customerFirstName;
unicode_string customerLastName;
} customerName;
} customer;
boolean current;
byte document;
string socSecNumber;
unicode_char billPaid;
}The following sample code shows the translation of the structure data field to XML:
<WebmethodsAdapter>
<event name="Sample::GetCustomerAllFieldsStruct">
<customer>
<customerName>
<customerFirstName>Joe</customerFirstName>
<customerLastName>Smith</customerLastName>
</customerName>
<customerId>14621</customerId>
</customer>
<current>true</current>
<document>0</document>
<socSecNumber>123-45-6789</socSecNumber>
<billPaid>Y</billPaid>
</event>
</WebmethodsAdapter>Sequence Field
When a field of an event is a sequence field, add the attribute type=“seq” to the element for this field and expand each member of the sequence into an element with the same name as the sequence field. The tag name for the type attribute varies depending on your locale. For more information about locale settings, see Internationalization.
The following sample code shows a sequence field in a webMethods event:
eventtype Sample::GetCustomerAllFieldsSeq {
string depts[];
}The following sample code shows the translation of the sequence field to XML:
<WebmethodsAdapter>
<event name="Sample::GetCustomerAllFieldsSeq">
<depts type="seq">
<depts>sales</depts>
<depts>marketing</depts>
</depts>
</event>
</WebmethodsAdapter>Sequence of Structures Field
- One attribute is named element, and its value is struct.
- The other attribute is named type, and its value is seq.
The tag names for the element and type attributes vary depending on your locale. For more information about locale settings, see Internationalization.
The following sample code shows a sequence of structures field in a webMethods event:
eventtype Sample::GetCustomerAllFieldsSeqOfStructs {
struct {
unicode_string name;
unicode_string industry;
} company[];
}The following sample code shows the translation of the sequence of structures field to XML:
<WebmethodsAdapter>
<event name="Sample::GetCustomerAllFieldsSeqOfStructs">
<company element="struct" type="seq">
<company>
<name>ACME</name>
<industry>food</industry>
</company>
<company>
<name>Computer World</name>
<industry>computer</industry>
</company>
<company>
<name>Bob's Convenience Store</name>
<industry>retail</industry>
</company>
</company>
</event>
</WebmethodsAdapter>Sequence of Sequences Field
- One attribute is named element, and its value is seq.
- The other attribute is named type, and its value is seq.
The tag names for the element and type attributes vary depending on your locale. For more information about locale settings, see Internationalization.
The following sample code shows a sequence of sequences field in a webMethods event:
eventtype Sample::GetCustomerAllFieldsSeqOfSeqs {
string depts[][][];
}The following sample code shows the translation of the sequence of sequences field to XML:
<WebmethodsAdapter>
<event name="Sample::GetCustomerAllFieldsSeqOfSeqs">
<!-- sales & marketing depts -->
<depts element="seq" type="seq">
<!-- sales -->
<depts element="seq" type="seq">
<!-- sales America -->
<depts type="seq">
<depts>sales America East</depts>
<depts>sales America Central</depts>
<depts>sales America West</depts>
</depts>
<!-- sales Europe -->
<depts type="seq">
<depts>sales Europe East</depts>
<depts>sales Europe Central</depts>
<depts>sales Europe West</depts>
</depts>
</depts>
<!-- Marketing -->
<depts element="seq" type="seq">
<!-- marketing America -->
<depts type="seq">
<depts>mktg America East</depts>
<depts>mktg America Central</depts>
<depts>mktg America West</depts>
</depts>
<!-- marketing Europe -->
<depts type="seq">
<depts>mktg Europe East</depts>
<depts>mktg Europe Central</depts>
<depts>mktg Europe West</depts>
</depts>
</depts>
</depts>
</event>
</WebmethodsAdapter>Installing the webMethods Adapter
- Change to the install_dir/bin directory.
- Install the webMethods java API library version 5.0.1 file (client50.jar) using the following command:
./install3rdpParty.sh webmethodsversion-jabsolutePath/filenameFor example:
./install3rdParty.sh webmethods 5.0 -j /home/webmethods/client50.jar - If you want the webMethods adapter to support secured socket layer
(SSL), install the webMethods SSL shared library file (libawssl50jn.so)
using the following command:
./install3rdParty.sh webmethodsversion-labsolutePath/filenameFor example:
./install3rdParty.sh webmethods 5.0 -l /home/webmethods/libawssl50jn.so
Implementing the webMethods Publisher Adapter
The webMethods Publisher adapter enables business processes that run in Sterling B2B Integrator to publish events to a webMethods Enterprise server.
You can create multiple configurations of the webMethods Publisher adapter. Because the client group defines which events a webMethods Publisher adapter has permission to publish, you must configure a separate instance of the adapter for each client group.
- Create webMethods Publisher adapter configuration. For information, see Managing Services and Adapters.
- Configure the webMethods Publisher adapter. For information, see Configuring the webMethods Publisher Adapter.
- Use the webMethods Publisher adapter in a business process.
Configuring the webMethods Publisher Adapter
Sterling B2B Integrator Configuration
The following table describes the fields used to configure a webMethods Publisher adapter 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:
Note: For more information about groups, see Managing Services
and Adapters.
|
| Webmethods Host (webmethodsHost) | Host name of the webMethods Enterprise server with which the adapter communicates. Required. |
| Webmethods Port (webmethodsPort) | Port number of the webMethods Enterprise server with which the adapter communicates. Required. |
| Broker Name (webmethodsBrokerName) | Name of the webMethods broker client with which the adapter communicates. Required. |
| Client Group (webmethodsClientGroup) | Name of the client group, which defines the events the adapter has permission to generate. The client group must exist on the webMethods Enterprise server. Required. |
| Certification File (certFile) | Absolute path to the certificate used for secure authentication and SSL encryption. Optional. |
| Password (certPassword) | Password for the certificate used for secure authentication and SSL encryption. Optional. |
| Distinguished Name (certDN) | Distinguished name for the certificate used for secure authentication and SSL encryption. Optional. |
GPM Configuration
The following table describes the fields used to configure a webMethods Publisher adapter in the GPM:
| Field | Description |
|---|---|
| Config | Name of the adapter configuration. |
| webmethodsEventName | Fully qualified event name (for example, Sample::GetCustomer). Optional. |
| webmethodsSynchronousFlag | Mode of communication with the webMethods Enterprise
server:
|
| webmethodsTimeOut | Amount of time in milliseconds to wait for an acknowledgment or a return event. Required. |
| language | Language used for internationalization. If no value is specified, English is the default. Optional. |
| country | Country used for internationalization. Optional. |
| variant | Vendor- or browser-specific value used for internationalization. Optional. |
Sample BPML
The following sample BPML is for a webMethods Publisher adapter:
...
<operation name="Webmethods Publisher">
<participant name="Webmethods Publisher"/>
<output message="WebmethodsInputMessage">
<assign to="." from="*"</assign>
<assign to="webmethodsTimeOut">5000</assign>
<assign to="webmethodsSynchronousFlag">true</assign>
<assign to="language">fr</assign>
<assign to="country">FR</assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
...- Specifies webmethodsTimeOut and webmethodsSynchronousFlag, because they are required. If they are not specified, you receive an error when the business process runs.
- Does not specify webmethodsEventName because it is not required by the webMethods adapter.
- Does not specify webmethodsHost, webmethodsPort, webmethodsBrokerName, and webmethodsClientGroup. The webMethods adapter assumes these parameters are configured in Sterling B2B Integrator. If they are not specified in Sterling B2B Integrator, you receive an error when the business process runs.
- Does not specify certFile, certPassword, and certDN, because they are not required by the webMethods adapter. They may or may not be configured in Sterling B2B Integrator. If they are not specified in Sterling B2B Integrator, no security is used.
- Specifies language and country, in this case, French as the language and France as the country. The adapter assumes the tags in the incoming document are in French.
Find this sample BPML in the samples directory.
Data Flow
- When a business process needs to publish an event to the webMethods Enterprise server, it starts a webMethods Publisher adapter.
- The webMethods Publisher adapter converts the incoming primary document to a webMethods event and publishes the event to the webMethods Enterprise server.
- If the configured mode of communication is synchronous, an output
document contains the information returned to the webMethods Publisher
adapter from the webMethods Enterprise server.
If the configured mode of communication is asynchronous, no output document is returned.
- When the event is published successfully, the webMethods Publisher adapter returns a status of Success to Sterling B2B Integrator.
- Sterling B2B Integrator performs the next step in the business process.
Error Messages
When a business process runs a webMethods Publisher adapter, the adapter can return the following error messages in the Advance Status field. The adapter logs more detailed error information in the log files.
| Error Message | Description |
|---|---|
| Error occurred when creating a broker client | One of the following configuration parameters was
invalid:
|
| Broker can not publish this event | Specified event was not in the CanPublish list for the client group. |
| Error happened when parsing the incoming XML document | Either the XML document was not well-formed, or the structure of the XML document did not match the event to be published. |
| Timed out before the reply event is received | Adapter, communicating in synchronous mode with the webMethods Enterprise server, did not receive a reply event within the specified timeout period. |
| Received unexpected acknowledgment when publishing synchronously | Adapter, communicating in synchronous mode with the webMethods Enterprise server, expected a reply event but received an acknowledgment instead. |
| Error happened while invoking this adapter | Error occurred when a business process started the adapter. This is a general-purpose error message. For more details, check the log file. |
Implementing the webMethods Subscriber Adapter
The webMethods Subscriber adapter enables Sterling B2B Integrator users to subscribe to webMethods events. When an event is received from the webMethods Enterprise server, a user-specified business process is started in Sterling B2B Integrator.
When you create and save a configuration of the webMethods Subscriber adapter, the adapter starts and subscribes to all events specified in Sterling B2B Integrator. No business process can explicitly run this adapter. You must specify a business process related to each event. This is the business process Sterling B2B Integrator starts when it receives the specified event from the webMethods Enterprise server.
- Create a webMethods Subscriber adapter configuration. For information, see Managing Services and Adapters.
- Configure the webMethods Subscriber adapter. For information, see Creating a webMethods Subscriber Adapter Configuration.
- Use the webMethod Subscriber adapter in a business process.
Creating a webMethods Subscriber Adapter Configuration
The following tables describe the fields used to configure a webMethods Subscriber adapter in Sterling B2B Integrator and connections for the webMethods Subscriber adapter in a property file.
Sterling B2B Integrator Configuration
The following table describes the fields used to configure the webMethods Subscriber adapter 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:
Note: For more information about groups, see Managing Services
and Adapters.
|
| Webmethods Host | Host name of the webMethods Enterprise server with which the adapter communicates. Required. |
| Webmethods Port | Port number of the webMethods Enterprise server with which the adapter communicates. Required. |
| Broker Name | Name of the webMethods broker client with which the adapter communicates. Required. |
| Client Group | Name of the client group, which defines the events the adapter has permission to generate. The client group must exist on the webMethods Enterprise server. Required. |
| Certification File | Absolute path to the certificate used for secure authentication and SSL encryption. Optional. |
| Password | Password for the certificate used for secure authentication and SSL encryption. Optional. |
| Distinguished Name | Distinguished name for the certificate used for secure authentication and SSL encryption. Optional. |
| Event x Business Process x |
Where x is a number from 1 to 20. Specify up to
20 pairs of events and business process combinations. The event is
the fully qualified event name (for example, Sample::GetCustomer)
or a wildcard (*). The business process is the name of the business
process to start upon receipt of the associated webMethods event.
At least one event and business process combination is required; additional
event and business process pairs are optional. The following rules
apply to the pairs of events and business processes:
|
To create a webMethods Subscriber adapter with different hosts, ports, broker names, client groups, or security parameters, you must create multiple configurations of the adapter. Each configuration defines a unique set of parameters.
Configuring the Property File
The webMethods Subscriber adapter polls the webMethods Enterprise server periodically to determine whether the adapter is still connected to the server. You must configure connection management parameters in the property file. The webmethods.properties file is located in install_dir/properties/adapter_conf, where install_dir is your Sterling B2B Integrator installation directory.
The following table describes the fields used to configure the connection management parameters in the property file:
| Field | Description |
|---|---|
| Connection_Polling_Interval | How often the connection between the adapter and
the webMethods Enterprise server is checked. You can specify a number
with the following suffixes:
|
| Connection_Polling_Interval_ Disconnected | How often the connection between the adapter and
the webMethods Enterprise server is checked after the connection is
down. You can specify a number with the following suffixes:
|
| Disconnected_Timeout_Period | How long a downed connection between the adapter
and the webMethods Enterprise server is checked before the adapter
is shut down. You can specify a number with the following suffixes:
|
Data Flow
- The user specifies all the required parameters in Sterling B2B Integrator as well as all the events to subscribe to and the business processes to start, and then saves the adapter configuration.
- The webMethods Subscriber adapter validates the configuration
parameters. If the parameters are valid, the webMethods Subscriber
adapter starts and subscribes to all the events in the webMethods
Enterprise server that were specified in Sterling B2B Integrator.
If any of the parameters are invalid, an error is logged.
- The webMethods Enterprise server publishes the events the webMethods Subscriber adapter subscribes to, and the adapter starts the associated business processes in Sterling B2B Integrator.
- You stop the webMethods Subscriber adapter from Sterling B2B Integrator.
- You update and save the adapter configuration in Sterling B2B Integrator, and it contains invalid parameters.
- The connection to the webMethods Enterprise server goes down and is not reestablished.
When you update the configuration of a webMethods Subscriber adapter—change the Webmethods Host, Webmethods Port, Broker Name, Client Group, Certification File, Password, or Distinguished Name parameter—the connection to the webMethods Enterprise server ends, and a new connection is made.
Error Messages
The webMethods Subscriber adapter starts when you save its configuration, either new or updated, in Sterling B2B Integrator. If the adapter starts successfully, no error logs are created. If the adapter does not start successfully, errors are logged and the adapter does not run.
The webMethods Subscriber adapter can log the following error messages:
| Error Message | Description |
|---|---|
| Exception happened when creating broker client | One of the following configuration parameters was
invalid:
|
| Error happened when starting connection manager | The connection manager, which controls the connection between the adapter and the webMethods Enterprise server, did not start correctly. |
| Need to have a BP for event eventName | The specified event (eventName) did not have an associated business process. |
| Cannot find event with name eventName | The client group did not include the specified event (eventName). |
| Already defined one default BP for businessProcess | A wildcard (*) was used as an event for more than one business process (businessProcess). |
| Already defined one BP businessProcess for event eventName | The specified event (eventName) was entered more than once with different business process names. |
| Need to subscribe to at least one event | No event was specified in the configuration in Sterling B2B Integrator. |
| Error happened when subscribing to event eventName | An error occurred when the adapter tried to subscribe to an event (eventName) in the webMethods Enterprise server. |
| Error happened when unsubscribing to event eventName | An error occurred when the adapter tried to unsubscribe to an event (eventName) in the webMethods Enterprise server. |
| Error happened when registering callback | The adapter could not register the callback. |
| Error happened when listening for subscriptions | The broker client could not listen for subscriptions. |
| Error happened when waiting for ongoing BPs | When the adapter configuration is updated or when the connection between the adapter and the webMethods Enterprise server goes down, a new broker client and subscriptions are created. If something goes wrong during this process, the adapter checks if it is processing any events from the webMethods Enterprise server. If events are being processed, the adapter waits until the processing completes before it stops. This error occurred when something went wrong before the events completed processing. |
| Error disconnecting client from webMethods | The adapter needed to stop, but could not disconnect correctly from the webMethods Enterprise server. |
| Error happened when retrieving valid events from webMethods | An error occurred when the adapter tried to retrieve all the events that the client group could subscribe to from the WebMethods Enterprise server. |
DTD Generator
- Create a DTD to validate incoming XML for a webMethods event.
- Retrieve a list of events from webMethods for a client group.
Use the DTD generator from a computer that has an instance of Sterling B2B Integrator with the DTD generator and can communicate with the webMethods Enterprise server.
To use the DTD generator, run the following command under your ${INSTALL_DIR}/bin directory:
run WMDtdGenerator.shThe DTD generator provides both a command line interface and an interactive interface. Use the following syntax for the command line interface:
run WMDtdGenerator.sh
-h <host> -p <port> -c <client group> -b <broker name>
-e <event name> -f <output file name> -l -noDTD The following table describes the options you can define on the command line:
| Option | Definition |
|---|---|
| -h <host> | Host name of the webMethods Enterprise server. |
| -p <port> | Port number of the webMethods Enterprise server. |
| -c <client group> | Name of the webMethods-defined client group. |
| -b <broker name> | Name of the broker on the webMethods Enterprise server. |
| -e <event name> | Fully qualified event name (for example, Sample::GetCustomer). |
| -f <output file name> | Path of the file where you want to write the DTD. To write the DTD to the console, type none as the output file name. If the DTD generator cannot create the output file, it writes the DTD to a file in the default temporary file directory and indicates the location of the file in a message to the console. |
| -l | Option to retrieve a list of events for the specified client group. Do not include the -e or -f option. Do include the -noDTD option; otherwise, the DTD generator assumes you want to generate a DTD and prompts you for the information needed to generate that DTD. |
| -noDTD | Use with the -l option to indicate you do not want to generate a DTD. |
The DTD generator prompts for any information it needs that you do not provide on the command line. To run the DTD generator in interactive mode, do not include any options and it will prompt you for them.
Security
The webMethods software provides support for authentication using digital certificates. The webMethods adapter supports communicating with the webMethods Enterprise server through SSL and certificates. Authentication is optional depending on how you configure the webMethods adapter and the webMethods Enterprise server to meet user security requirements. For information about SSL support of the webMethods Enterprise server as well as how to obtain a certificate, see the webMethods documentation.
- Server-side authentication with encryption – You must configure the certificate file and password. The default distinguished name is used.
- Server and client-side authentication with encryption – You must configure the certificate file, password, and distinguished name.
- No authentication or encryption – If the client group that owns the adapter does not require authentication, no configuration is required.
For information about configuring the security parameters (certificate file, password, distinguished name), see Configuring the webMethods Publisher Adapter and Creating a webMethods Subscriber Adapter Configuration.
For the webMethods adapter to use SSL to communicate with the webMethods Enterprise server, you must also specify the SSL shared library file. For information about installing the SSL shared library, see Installing the webMethods Adapter.
Internationalization
You can specify language, country, and variant in the GPM. These parameters define the internationalization rules the webMethods Publisher adapter uses when translating the input and output documents. If you do not specify language, country, or variant, the adapter uses English.
- event
- name
- element
- type
For information about how the adapter translates input and output documents, see Structure of Input and Output Data.