Built-in Services

IBM webMethods Integration has an extensive library of services for performing common integration tasks such as transforming data values, performing simple mathematical operations.

Services are started at run time. While creating a flow service, you can sequence services and manage the flow of data among them.

Related services are grouped in categories. Input and output parameters are the names and types of fields that the service requires as input and generates as output and these parameters are collectively referred to as a signature.

Service Category Description
Alert Use the Alert services to notify users when predefined conditions, such as password expiry, license key updates, rule violations, or service errors, are met, ensuring timely awareness and response to critical system events.
B2B Utils Use the B2B Utils services to perform generateResponse, constructSubmitInput, parseContent operations in IBM webMethods Integration.
Compress Use Compress services to compress the data before sending the HTTP request and decompress it after receiving the HTTP response.
Date Use Date services to generate and format date values.
Datetime Use Datetime services to build or increment a date/time. The services in datetime provide more explicit timezone processing than similar services in the Date category.
Document Use Document services to perform operations on documents.
E2E Monitoring Use the End-to-End Monitoring services to do the operations specific to IBM webMethods End-to-End Monitoring like setting a custom transaction ID.
Flat File Use Flat File services to convert data bytes, data stream, and data string to a document and vice versa.
Flow Use flow services to perform utility-type tasks.
Hashtable Use Hashtable services to create, update, and obtain information about the hashtable.
IO Use IO services to convert data between byte[ ], characters, and InputStream representations. These services are used for reading and writing bytes, characters, and streamed data to the file system. These services behave like the corresponding methods in the java.io.InputStream class. These services can be started only by other services. Streams cannot be passed between clients and the server, so these services will not execute if they are started from a client.
JSON Use JSON services to convert JSON content into a document and to convert a document into JSON content.
List Use List services to retrieve, replace, or add elements in an Object List, Document List, or String List, including converting String Lists to Document Lists.
Math Use Math services to perform mathematical operations on string-based numeric values. Services that operate on integer values use Java's long data type (64-bit, two's complement). Services that operate on float values use Java's double data type (64-bit IEEE 754). If extremely precise calculations are critical to your application, you should write your own Java services to perform math functions.
MIME Use MIME services to create MIME messages and extract information from MIME messages.
Schema Use Schema services to validate objects and to validate the pipeline.
Storage Use Storage services to insert, retrieve, update, and remove entries from a data store.
String Use String services to perform string manipulation and substitution operations.
Transaction Use Transaction services only in conjunction with the Database Application operations. These services are applicable when the Database Application account is of type Transactional.
Utils Use Utility services to generate a random Universally Unique Identifier (UUID) or to generate a message digest for a given message.
XML Use XML services to convert a document to XML content and XML content to a document.
Reference Data Use Reference Data services to upload reference data that defines the set of permissible values to be used by other data fields.
JWT Use JSON Web Token(JWT) for securely exchanging information as a JSON object between parties.
SMIME Use smime services to create digitally signed and/or encrypted MIME messages.
Security Use security services to control which client certificates are sent to other services and digitally sign data and process digital signatures. You can also use the service to store and retrieve outbound passwords to access secure resources.
Keystore
Pkcs7 Creates a PKCS7 Data object.
Document Use document services to perform operations on documents in the pipeline.
String Use string services to perform string manipulation and substitution operations.
Note: When deploying a flow service in a multi-instance setup, the service is synchronized across both instances but operates on only one instance during execution. For example, if the flow service includes an alert.emit service, it exists in both instances but functions only within one instance at a time.

Alert services

Use the Alert services to notify users when predefined conditions, such as password expiry, license key updates, rule violations, or service errors, are met, ensuring timely awareness and response to critical system events.

The following Alert services are available:

Service Description
emit Performs an alert when a pre-configured condition is met.
channels Gets all alert channels in the system. Channels help classify alerts and let you subscribe to a specific type of alert.
countAll Gets the count of all alerts in the system, read and unread, or a subset of alerts that meet the filter criteria.
fetchAll Fetch all alerts in the system, including read and unread, or a subset based on filter criteria.
getSettings Gets the settings of the system notifier.
setSettings Updates the settings of the system notifier.
deregisterChannel Deregisters a registered custom channel.
getChannel Gets the details of a specific channel.
registerChannel Registers a custom channel.
updateChannel Updates the settings of a channel.
severities Lists the pre-defined severities that you can associate with an alert channel. The severity associated with an alert lets you assess the relative impact of a business event on the system.

emit

Generates an alert when a pre-configured condition is met. For example, User or Master Password Expiry, License Key Update, Enterprise Gateway Rule Violation, Service Error, and so on. This service is started by IBM webMethods Integration components to raise alerts.

Input Parameters

channelID: Integer. Identifier of the channel associated with the alert.

severity: String. Severity associated with the alert channel.

subject: String. Subject of the alert message.

contentType: String. Type of information in the alert. For example, text/plain.

content: String. Content of an alert. For example, Alert {0} Message Size Limit filter failed.\nClient IP Address: {1}\n Request URL : {2}\n Date & Time : {3} content

Output Parameters

alertId: Long. A unique identifier assigned to each alert emitted.

channels

Gets all alert channels in the system. Channels help classify alerts and let you subscribe to a specific type of alert.

Input Parameters

None.

Output Parameters

Channels: Document List. The list of alert channels in IBM webMethods Integration. By default, there are 13 channels. All channels have the following keys:

  1. id - Integer. Identifier of a channel. This is a system assigned value and cannot be modified.
    Note: Channel IDs for custom channels start with 1001.
  2. displayName: String. Name of the alert channel.

  3. description: String. Description for the channel.

  4. emissionEnabled: Boolean. Indicates whether an alert is generated for the channel and stored in the database or not. A value of:

    • true indicates that alerts are emitted for the channel and stored in the database.

    • false indicates that alerts are disabled for the channel.

  5. systemNotificationEnabled: Boolean. Indicates whether an alert generated for the channel is displayed as a notification or not.

    • true indicates that notifications are generated for the channel.
    • false indicates that notifications are disabled for the channel.

Usage Notes

The default channels, events when alerts are raised for a channel, and the corresponding severity are described in the following table:

Channel ID Channel Name Events Severity
1 Service Error Service execution errors.
Note: By default, service error notifications are disabled.
Error
2 Server Error Server errors such as HTTP 404.
Note: By default, server error notifications are disabled.
Error
3 Password Management A user password expires.

A user password is about to expire.

Default administrator password is not changed.

Critical Warning
4 License Management IBM webMethods Integration license expires.

IBM webMethods Integration license is about to expire.

Critical Warning
5 Certificate Management A security certificate is about to expire. Warning
6 Account Locking Multiple login attempt failures that result in a locked account.

A locked account is unlocked.

CriticalInformation
7 Authentication Login failure limit is reached. Error
8 Package Management Package subscription (Delivery)

Package subscription (Release)

Note: By default, package management notifications are disabled.
Information
9 Threat Protection Enterprise Gateway deny rule violation.

Enterprise Gateway allow rule violation.

Critical Warning
10 Meeting Log Errors connecting to the Metering agent server. Error
11 User Management User management related alerts Warning
12 Master Password A master password expires.

Default master password is not changed.

Warning
13 Hybrid Connections Tenant connection disconnected

Tenant connection restored

Account disconnected

Account restored

Error Information

Error Information

countAll

Gets the count of all alerts in the system, read and unread, or a subset of alerts that meet the filter criteria.

Input Parameters

  • filter: Document. Optional. To get the count of a subset of alerts, specify the criteria using the following keys:
    • startTime: Long. Optional. Start of the time interval in which alerts are emitted. Specify the value in UNIX epoch format in milliseconds.
    • endTime: Long. Optional. End of the time interval in which alerts are emitted. Specify the value in UNIX epoch format in milliseconds.
    • severities: String[]. Optional. List of severities.
    • channelIds: Object[]. Optional. List of channel identifiers.
    • user: String. Optional. The IBM webMethods Integration user who triggered the alerts or Administrator for alerts emitted by the server. For example, specify Administrator for Password Management alerts.
    • keyword: String. Optional. A keyword that identifies the alerts.

Output Parameters

  • count: Long. The count of all alerts in the system, read and unread, or a subset of alerts, if the filter criteria are passed as inputs.

Usage Notes

To get the count of all alerts in the system, read and unread, do not specify the filter criteria as inputs.

fetchAll

Fetch all alerts in the system, including read and unread, or a subset based on filter criteria.

Input Parameters

  • filter: Document. Optional. To fetch a subset of alerts, specify the criteria using the following keys:
    • startTime: Long. Optional. Start of the time interval in which alerts are emitted. Specify the value in UNIX epoch format in milliseconds.
    • endTime: Long. Optional. End of the time interval in which alerts are emitted. Specify the value in UNIX epoch format in milliseconds.
    • severities: String[]. Optional. List of severities.
    • channels: Object[]. Optional. List of channel identifiers.
    • user: String. Optional. The IBM webMethods Integration user who triggered the alerts or Administrator for alerts emitted by the server. For example, specify Administrator for Password Management alerts.
    • keyword: String. Optional. A keyword that identifies the alerts.
  • sortOrder: String. Optional. The order in which the fetched alerts are sorted. Select ASC or DESC. The default is DESC.
  • sortBy: String. Optional. The criteria to sort the fetched alerts. Select one of the following options:
    • channel
    • severity
    • subject
    • timestamp

The default is timestamp.

  • pageSize: Integer. The number of notifications on a page.
  • pageNumber: Integer. In a paginated list of notifications, the page where IBM webMethods Integration loads the notifications.
    Note: Page number starts with 0.

Output Parameters

  • alerts: Document List. A list of the alerts retrieved by the service. Each alert has the following details:
    • id: Long. Alert identifier.
    • ts: Long. Date and time when the alert is generated, in the UNIX epoch time format.
    • serverId: String. IP address of the host where IBM webMethods Integration is running.
    • memberName: String. Member name of the machine that hosts IBM webMethods Integration in a cluster.
    • user: String. IBM webMethods Integration user who triggered the alert.
    • channelId: Integer. Channel identifier for the alert.
    • channel: String. Channel for the alert.
    • severityId: Integer. Severity identifier of the alert.
    • severity: String. Severity of the alert.
    • subject: String. Subject of the alert message.
    • contentType: String: Text that identifies the type of content in the alert such as text/plain and text/html.
    • content String. Content of the alert.

Usage Notes To fetch all read and unread alerts in the system, do not specify the filter criteria as inputs. The number of notifications on a page is identified by pageSize and the current page is identified by pageNumber .

getSettings

Gets the settings of the system notifier.

Input Parameters

None.

Output Parameters

  • enabledEmissionChannels: Object[]. List of channels for which alerts can be generated and stored in the database.
  • enabledSystemNotifierChannels: Object[]. List of channels for which alerts are generated and displayed as notifications.
  • systemNotifierSeverityCutoff: String. Notifications are generated only for alerts with severity equal to, or more than this value.
  • retentionPeriodInDays: Integer. Determines how long the alerts are stored in the database.
  • certificateExpiryWarningInDays: Integer. Number of days before the certificate expiry date, when the alert should be generated.

setSettings

Updates the settings of the system notifier.

Input Parameters

  • enabledEmissionChannels: Object[]. List of channels for which alerts can be generated and stored in the database.
  • enabledSystemNotifierChannels: Object[]. List of channels for which alerts are generated and displayed as notifications.
  • systemNotifierSeverityCutoff: String. Notifications are generated only for alerts with severity equal to, or more than this value.
  • retentionPeriodInDays: Integer. Determines how long the alerts are stored in the database.
  • certificateExpiryWarningInDays: Integer. Number of days before the certificate expiry date when the alert should be generated.

Output Parameters

message: String. Indicates whether the system notifier settings are updated or not.

Usage Notes

Based on the value of the retentionPeriodInDays parameter, a purge job clears the alerts stored in the database.

deregisterChannel

Deregisters a registered custom channel.

Input Parameters

channelId Integer: Identifier of the channel that you want to deregister.

Output Parameters

  • deregistered: Boolean. Indicates whether the channel is deregistered or not. A value of:

    • true indicates that the channel is deregistered.

    • false indicates that the channel is not deregistered.

Usage Notes

Channel IDs for custom channels are generated by the system and cannot be modified. The first custom channel gets 1001 as the channel ID and subsequent custom channels have consecutive numbers. Once a custom channel is deregistered, the channel ID is no longer available for a new custom channel until IBM webMethods Integration is restarted.

Deregistering a channel also deletes all the alerts for that channel.

getChannel

Gets the details of a specific channel.

Input Parameters

channelId Integer: Identifier of the channel that you want to retrieve.

Output Parameters

  • displayName String. Name of the channel.

  • description String. Description for the channel.

  • emissionEnabled: Boolean. Indicates whether an alert is generated for the channel and stored in the database or not. A value of:

    • true indicates that alerts are emitted for the channel and stored in the database.

    • false indicates that alerts are disabled for the channel.

  • systemNotificationEnabled: Boolean. Indicates whether an alert generated for the channel is displayed as a notification or not.

    • true indicates that notifications are generated for the channel.

    • false indicates that notifications are disabled for the channel.

registerChannel

Registers a custom channel.

Input Parameters

  • displayName: String. Name of the channel that you want to register.
  • description: String. Optional. Description of the channel.
  • emissionEnabled: Boolean. Optional. Indicates whether an alert is generated for the channel and stored in the database or not. Set to:
    • true to emit alerts for the channel and store them in the database.
    • false to disable alerts for the channel.

The default value is true for custom channels as well as system channels other than Service Error and Server Error.

  • systemNotificationEnabled: Boolean. Optional. Indicates whether the alert generated for the channel is displayed as a notification or not. Set to:
    • true to generate notifications for the channel.
    • false to disable notifications for the channel.

The default value is true for custom channels as well as system channels other than Service Error and Server Error.

Output Parameters

  • channelId: Integer. Identifier of the registered channel.
    Note: Channel IDs for custom channels start with 1001.

Usage Notes For custom channels, channel IDs are generated by the system and cannot be modified. The first custom channel gets 1001 as the channel ID and subsequent custom channels have consecutive numbers. Once a custom channel is deregistered, the channel ID is no longer available for a new custom channel until IBM webMethods Integration is restarted.

updateChannel

Updates the settings of a channel.

  • channelId: Integer. Identifier of the alert channel that you want to update.
Note: Channel IDs for custom channels start with 1001.
  • description: String. Optional. Description of the channel.
  • emissionEnabled: Boolean. Optional. Indicates whether an alert is generated for the channel and stored in the database or not. Set to:
    • true to emit alerts for the channel and store them in the database.
    • false to disable alerts for the channel.

    The default value is true for custom channels as well as system channels other than Service Error and Server Error.

  • systemNotificationEnabled: Boolean. Optional. Indicates whether the alert generated for the channel is displayed as a notification or not. Set to:
    • true to generate notifications for the channel.
    • false to disable notifications for the channel.

    The default value is true for custom channels as well as system channels other than Service Error and Server Error.

Output Parameters

message: String. Indicateswhether the channel is successfully updated or not.

Usage Notes

Invoke the alert:updateChannel service to ignore a notification of a specific type or restore an ignored notification from IBM webMethods Integration Administrator.

severities

Lists the pre-defined severities that you can associate with an alert channel. The severity associated with an alert lets you assess the relative impact of a business event on the system.

Input Parameters

None.

Output Parameters

  • Severities: Document List. The list of default severities available in the system. By default, 4 severities are configured.
    • id: Integer. Identifier for a severity. The default severities and their IDs are as follows:
       0: Critical, 1: Error, 2: Warning, 3: Information
    • displayName: String. The severity name.

B2B Utils services

generateResponse

Generates a response for the processing rule Call an integration action.

Note: generateResponse does not support large document.

Input Parameters

  • inputContent: Object. Content data sent as part of integration response after encoding.
  • readContentAs: String. Data type in which inputContent field value is passed.
    • bytes.inputContent is read as bytes.
    • string. inputContent is read as a string.
  • contentType: String. Content-Type passed corresponds to inputContent field. For example, application/EDI, application/x12, text/plain and so on.
  • attachments: Document List. (optional) List of attachments sent as part of integration response, if any.
  • name: String. Name of the attachment.
  • inputContent: Object. Content of the attachment.
  • readContentAs: String. Data type in which inputContent field value is passed.
    • bytes. inputContent is read as bytes.
    • string. inputContent is read as String.
  • contentType: String. Content type of the attachment. For example, application/zip if the attachment is a ZIP file.
  • encoding: String. (Optional) Encoding of the attachment. Default value is UTF-8.
  • otherHeaders: Document. (Optional) Add key and value strings of the header to the attachment.
    • headers: Document. (optional) Headers sent as part of the integration response, if any.
    • errorCode: String. Value of error code passed as part of integration response.
    • errorMessage: String. Value of error message passed as part of integration response.
    • encoding: String. Type of character set used for encoding inputContent value. This can be any IANA registered character set. Default UTF-8.

Output Parameters

  • response: Document. Response is a composite object containing the parameters:

    • content: String. Encoded in Base64. Value is specified in encoding.

    • type: String. Value specified in contentType.

    • encoding: String. Type of encoding used to encode the inputContent. Value is specified in encoding.

    • attachments: Document. List of attachments received from the input parameter * attachments*, if any.

    • headers: Document. Headers received from the input parameter headers.

  • error: Document. Error is a composite object containing the fields:

    • code: String. Error code received from the input. Value is specified in errorCode.
    • message: String. Error message associated with the input. Value is specified in errorMessage.

constructSubmitInput

This operation is deprecated in the IBM webMethods B2B application and now included as a B2B Utils built-in service in IBM webMethods Integration. You must modify your integration to use this operation in the B2B Utils instead of the IBM webMethods B2B application.

Prepare the necessary input used for submitting the business documents to IBM webMethods B2B product instance.

Input Parameters

  • type: String. The input parameter type that is generated for AS2, AS4, RNIF20, RNIF11, or cXML.
  • DoctypeName: String. The name of the document type. This is case-sensitive.
    • For AS4 Push, use ebMS 3.0 UserMessage.
    • For AS4 Pull, use ebMS 3.0 PullRequest Signal.
    • For RNIF, it is the xml document type based on the PIP.
    • For cXML, it is the xml document type.
  • SenderID: String. Required for AS4, and cXML. Sender Identity value from the partner profile. For example, 123456789.
  • SenderIDType: String. Required for AS4, and cXML. Sender Identity type from the partner profile. For example, DUNS, DUNS+4.
  • ReceiverID: String. Required for AS4, and cXML. Receiver Identity value from the partner profile. For example, 123456789.
  • ReceiverIDType: String. Required for AS4, and cXML. Receiver Identity type from the partner profile. For example, DUNS, DUNS+4.
  • ConversationID: String. Required for RNIF when acting as a responder. The set of related messages that create a conversation between two partners.
  • preferredOutboundChannelID: String. Overrides the channel to send the document from the receiver’s preferred channel selected in IBM webMethods B2B to a channel ID added in this parameter.

    In an AS4 message, when the value is not specified, the system generates a unique ID. The value maps to Messaging/UserMessage/CollaborationInfo/ConversationId.

  • otherParams: Document. (Optional) Other keys that you need to pass as Params in the submit service.
  • as2: Document. Required for AS2 type document. Configure the following AS2 parameters:
    • body: Document. (Optional) AS2 body document. For more information to configure inputContent, readContentAs, contentType and encoding see, Input parameters of Submit operation in webMethods_io_B2B.
    • attachments []: Document List. (Optional). For more information to configure AS2 attachments (name, inputContent, readContentAs, contentType, encoding and otherHeaders).
    • headers: Document. (Optional) Add key and value strings of the header to the payload.
    • params: Document. A document that provides parameters on how IBM webMethods B2B recognizes and processes a AS2 document.

      as2SenderID: String. Sends the EDIINT AS2 identity as AS2-From value when using AS2 out channel in IBM webMethods B2B.

      as2ReceiverID: String. Sends the EDIINT AS2 identity as AS2-To value when using AS2 out channel in IBM webMethods B2B.

  • as4: Document. Required for AS4 type document. Configure the following AS4 parameters:
  • rnif: Document. Required for RNIF type document. Configure the following RNIF parameters:
  • cXML: Document. Required for cXML type document. Configure the following cXML parameters:
    • body: Document. cXML body document. For more information on configuring inputContent, readContentAs, contentType and encoding see, Input parameters of Submit operation in webMethods_io_B2B .
    • attachments []: Document List. (Optional). For more information on configuring cXML attachments (name, inputContent, readContentAs, contentType, encoding and otherHeaders) .
    • params: Document. A document that provides parameters on how IBM webMethods B2B recognizes and processes a cXML document.

      Configuring cXML params.

      payloadID: String. A unique number of the document.

      userAgent: String. Optional. The software or application that processes the cXML data. For example, Ariba Network, Procure Software 3.3.

      sharedSecret: String. The password the sender shares with the receiver for security or authentication purpose.

      sync: String. Indicates if the message is synchronous or asynchronous. Valid values are:

      true. Synchronous message (Two-way/Sync for replying). false. Asynchronous message (One-way messages).

      deploymentMode: String. Optional. Indicates whether the request is a test request or a production request. The valid values are test or production .

      sender []: Document. Optional. Sender of the cXML document. Sends the sender identity as cXML-From value when using cXML out channel in IBM webMethods B2B. Add the idType and idValue to recognize and verify the identity of the sender who has initiated the HTTP connection for processing the cXML message.

      idType: String. Identity type from the partner profile. For example, DUNS, DUNS+4. idValue: String. Identity value from the partner profile. For example, 123456789.

      receiver []: Document. Optional. Receiver of the cXML document. Sends the receiver identity as cXML-To value when using cXML out channel in IBM webMethods B2B. Add the idType and idValue to recognize and verify the identity of the receiver of the cXML message.

      idType: String. Identity type from the partner profile. For example, DUNS, DUNS+4. idValue: String. Identity value from the partner profile. For example, 123456789.

Configuring an AS4 body

Document. To configure an AS4 body document. This is optional.

  • name: String. (Optional when only body is sent) Name of the payload content.

  • xmlInputContent: Object. XML content to submit to the IBM webMethods B2B product instance for processing. This is sent as SOAP BODY.

  • readContentAs: String. Data type in which xmlInputContent field value is accepted.

    • bytes. xmlInputContent is read as bytes.
    • string. xmlInputContent is read as string.
    • stream. xmlInputContent is read as stream. IBM recommends you to use readContentAs as stream if the size of the payload is over 5 MB.
  • encoding: String. (Optional) Type of character set used for encoding xmlInputContent value. This can be any IANA registered character set. The default value is UTF-8.

  • partInfo: Document. (Optional) AS4 payload part information.

    • schemaLocation: String. (Optional) URI of the schema. The value of this parameter maps to the location attribute of the Messaging/UserMessage/PayloadInfo/PartInfo/Schema element.

    • schemaVersion: String. (Optional) Version of the schema. The value of this parameter maps to the version attribute of the Messaging/UserMessage/PayloadInfo/PartInfo/Schema element.
    • schemaNamespace: String. (Optional) Target namespace of the schema. The value of this parameter maps to the namespace attribute of the Messaging/UserMessage/PayloadInfo/PartInfo/Schema element.
    • description: String. (Optional) Description of the content. The value of this parameter maps to the Messaging/UserMessage/PayloadInfo/PartInfo/Description element.
    • properties[]: Document List. (Optional) List of name and value pairs that are sent along with the message. The value of this parameter maps to the Messaging/UserMessage/PayloadInfo/PartInfo/PartProperties element.
      Note: For the final AS4 payload of MimeType application/octet-stream, then add the property name PayloadMimeType and value as application/octet-stream.
    • name: String. Name of the property. The value of this parameter maps to the name attribute of the Messaging/UserMessage/PayloadInfo/PartInfo/PartProperties/Property element.
    • value: String. Value of the property. The value of this parameter maps to the Messaging/UserMessage/PayloadInfo/PartInfo/PartProperties/Property element.

Configuring AS4 attachments [ ]

Document List. To configure AS4 attachments. This is optional.

  • name: String. Name of the attachment content.
  • inputContent: Object. Content of the attachment. It is sent as SOAP attachments.
  • readContentAs: String. Data type in which inputContent field value is passed.
    • bytes. inputContent is read as bytes.
    • string. inputContent is read as string.
    • stream. inputContent is read as stream. IBM recommends you to use readContentAs as stream if the size of the payload is over 5 MB.
  • contentType: String. Content type of the attachment. For example, application/zip if the attachment is .zip file.

  • encoding: String. (Optional) Encoding of the attachment. The default value is UTF-8.

  • partInfo: Document. (Optional) AS4 attachment part information.

    • schemaLocation: String. (Optional) URI of the schema. The value of this parameter maps to the location attribute of the Messaging/UserMessage/PayloadInfo/PartInfo/Schema element.
    • schemaVersion: String. (Optional) Version of the schema. The value of this parameter maps to the version attribute of the Messaging/UserMessage/PayloadInfo/PartInfo/Schema element.
    • schemaNamespace: String. (Optional) Target namespace of the schema. The value of this parameter maps to the namespace attribute of the Messaging/UserMessage/PayloadInfo/PartInfo/Schema element.
    • description: String. (Optional) Description of the content. The value of this parameter maps to the Messaging/UserMessage/PayloadInfo/PartInfo/Description element.
    • Properties[]: Document List. (Optional) List of name value pairs that are sent along with the message. The value of this parameter maps to the Messaging/UserMessage/PayloadInfo/PartInfo/PartProperties element.
      Note: For the final AS4 payload of MimeType application/octet-stream, then add the property name PayloadMimeType and value as application/octet-stream.
    • name: String. Name of the property. The value of this parameter maps to the name attribute of the Messaging/UserMessage/PayloadInfo/PartInfo/PartProperties/Property element.
    • value: String. Value of the property. The value of this parameter maps to the Messaging/UserMessage/PayloadInfo/PartInfo/PartProperties/Property element.

Configuring AS4 params

Document. A document that provides parameters on how IBM webMethods B2B recognizes and processes a AS4 document. Configure AS4 params.

  • messageId: String. (Optional) Unique identifier of the message. When value is not specified, the system generates a unique messageId. When the messageID is generated, the value of this parameter maps to Messaging/UserMessage/MessageInfo/MessageId.
  • soapAction: String. (Optional) Value of the action parameter in the MIME type.
  • pmodeId: String. (Optional for Push request) TPA agreement ID.
  • push: Document. (Required when DoctypeName is ebMS 3.0 UserMessage) AS4 push document.
    • sync: Boolean. (Optional) Synchronous or Asynchronous push request. Default value is false. Valid values are:

      true. Synchronous push reply (Used in MEP binding Two-Way/Sync for replying).

      false. Asynchronous push request (Used in MEP bindings for requesting).

    • refToMessageId: String. (Required when sync is true). Identifier used in two-way MEPs where the responding MSH user message refers to the initiating MSH user message.
    • toPartyIdRole: String. (Required when pmodeId or agreementRef is not specified) Initiator or responder role of the party in the message exchange.
    • fromPartyIdRole: String. (Required when pmodeId or agreementRef is not specified) Initiator or responder role of the party in the message exchange.
    • agreementRef: String. (Required when pmodeId is not specified) The value to use for the submit request. When pmodeId and agreementRef value is empty, then a tuple of From/ PartyId, From/Role, To/PartyId, To/Role, Service, and Action is used to identify the TPA agreement. For no agreementRef element in the final payload, agreementRef and pmodeId values in the service input and TPA agreement field should be empty.
    • service: String. (Required when PmodeId or agreementRef is not specified) Name of the service use to identify the RequestUM leg used for the current transaction. IBM webMethods B2B uses the service and action parameters to determine which RequestUM leg to use for the current transaction. IBM webMethods B2B compares the value of this parameter to the value of leg/businessInfo/service that is configured in all RequestUM legs of the TPA. The RequestUM leg that contains a match for both the service and action parameters is the leg that will be used for the current transaction. When there is only one RequestUM leg configured in the TPA, the service parameter does not have to be defined.
    • action: String. (Required when PmodeId or agreementRef is not specified) Name of action use to identify the RequestUM leg used for the current transaction. IBM webMethods B2B uses the service and action parameters to determine which RequestUM leg to use for the current transaction. IBM webMethods B2B compares the value of this parameter to the value of leg/businessInfo/action that is configured in all RequestUM legs of the TPA. The RequestUM leg that contains a match for both service and action is the leg that will be used for the current transaction. When there is only one RequestUM leg configured in the TPA, the action parameter does not have to be defined.
    • serviceType: String. (Optional) Name of the service type that indicates how the sender and receiver will interpret the service element. When no value is enter for this parameter, the service parameter must be a URI.
    • messageProperties: Document List. (Optional) List of name and value pairs that are sent along with the message. These pairs map to the zero or more Property child elements within Messaging/UserMessage/MessageProperties.

      name: String. The name of property.

      value: String. The value of property.

      type: String. (Optional) The type of property.

      endpointUrl: String. Endpoint address of the recipient. It retrieves from the operation retrievePeppolParticipantDetails .

Note: When exchanging documents over the peppol network, configuring the endpointUrl is mandatory, as it is used to send the documents in real-time.
  • pull: Document. (Required when DoctypeName is ebMS 3.0 PullRequest Signal) AS4 pull document.
    • mpc: String. (Optional) Indicates MPC (Message partitioning channel) from where to pull the queued message. Default MPC is used when not specified.
    • simpleSelectionItems[]: Document List. (Optional) Select a list of simple elements.

      element: String. The name of the element that has to be retrieved. This parameter refers to refToMessageId, conversationId, agreementRef, service, and action.

      elementvalue: String. The value of the element.

      attributeList[]: Document List. (Optional) A list of attributes.

      element: String. The name of the attribute.

      elementvalue: String. The value of the attribute.

    • complexSelectionItems[]: Document List. (Optional) Select a list of complex elements.

      element: String. The name of the element that has to be retrieved. This parameter refers to From, To, and MessageProperties.

      elementvalue: String. The value of the element.

      attributeList: Document List. (Optional) A list of attributes.

      element: String. The name of the attribute.

      elementvalue: String. The value of the attribute.

      childItems[]: Document List. (Optional) A list of child items.

      element: String. The name of the child item.

      elementvalue: String. The value of the child item.

      attributeList[]: Document List. (Optional) List of attributes.

      element: String. The name of the attribute.

      elementvalue: String. The value of the attribute.

Configuring an RNIF body

Document. To configure an RNIF body document.

  • xmlInputContent: Object. XML content to submit to the IBM webMethods B2B product instance for processing.
  • readContentAs: String. Data type in which inputContent field value is passed.

    • bytes. xmlInputContent is read as bytes.
    • string. xmlInputContent is read as string.
    • stream. xmlInputContent is read as stream. IBM recommends you to use readContentAs as stream if the size of the payload is over 5 MB.
  • encoding: (Optional) String. Encoding of the content body.

Configuring an RNIF attachments [ ]

Document List. To Configure a list of attachments to be use in RNIF message. This is optional.

  • name: String. Name of the attachment content

  • inputContent: Object. Content of the attachment.

  • readContentAs: String. Data type in which inputContent field value is passed.

    • bytes. inputContent is read as bytes.
    • string. inputContent is read as string.
    • stream. inputContent is read as stream. IBM recommends you to use readContentAs as stream if the size of the payload is over 5 MB.
  • contentType: String. Content type of the attachment.

  • encoding: (Optional) String. Encoding of the attachment.

Configuring an RNIF params

Document. A document that provides parameters on how IBM webMethods B2B recognizes and processes a RNIF document. Configure RNIF params.

  • rnif20: Document Configure the following parameters:

    • pipInfo: (Optional) Document. Document that represents RNIF 2.0 Partner Interface Processes Information (PIP)

      senderFocalRole: String. Validator of GlobalPartnerRoleClassificationCode tag describing fromRole in the service header. For valid values, see the fromService and fromRole details in the PIP specification corresponding to the executing PIP, activity, or action.

      receiverFocalRole: String. Validator of GlobalPartnerRoleClassificationCode tag describing toRole in the service header. For valid values, see the toService and toRole details in the PIP specification corresponding to the executing PIP, activity, or action.

      processCode String. Code or name of the PIP. For example, 3A4.

      processVersion: String. Version of the PIP process. Select either 1.1 or 1.4.

      transactionCode: String. Transaction associated with each RosettaNet PIP document.

      actionCode: String. Query action associated with each RosettaNet PIP document.

      enableSyncResponse: (Optional) Boolean. The flag to indicate that the transaction is expecting a sync response. Valid values are:

      true: The transaction is expecting a sync response.

      false: The transaction is not expecting a sync response. This is by default.

    • response: (Optional) Document. Response is a composite object containing the parameters.

      messageTrackingID: String. Unique instance identifier to identify message.

      inReplyToGlobalBusinessActionCode: (Optional) String. Action associated with request RosettaNet PIP document, for which IBM webMethods B2B sends the response.

      initiatingPartnerLocationID: String. Location ID of the partner. The initiating partner location ID: //ServiceHeader/ProcessControl/KnownInitiatingPartner/PartnerIdentification/locationID/Value for which IBM webMethods B2B sends the response.

  • rnif11: Document. Configure the following parameters:

    • pipInfo: (Optional) Document. Document that represents RNIF 1.1 Partner Interface Processes Information (PIP).

      senderFocalRole: String. Validator of the GlobalPartnerRoleClassificationCode tag describing fromRole in the service header. For valid values, see the fromService and fromRole details in the PIP specification corresponding to the executing PIP, activity, or action.

      receiverFocalRole: String. Validator of the GlobalPartnerRoleClassificationCode tag describing toRole in the service header. For valid values, see the toService and toRole details in the PIP specification corresponding to the executing PIP, activity, or action.

      processCode: String. Code or name of the PIP. For example, 3A4.

      processVersion: String. Version of the PIP process. Select either 1.1 or 1.4.

      transactionCode: String. Transaction associated with each RosettaNet PIP document.

      actionCode: String. Query action associated with each RosettaNet PIP document.

    • response: (Optional) Document. Response is a composite object containing the parameters.

      actionIdentityInstanceIdentifier: String. Unique instance identifier to identify message.

      inReplyToGlobalBusinessActionCode: (Optional) String. Action associated with request RosettaNet PIP document, for which IBM webMethods B2B sends the response.

Output Parameters

Output of constructSubmitInput operation is the input parameters for submit operation. See, Submit operation in webMethods_io_B2B.

parseContent

Parses request content passed by the processing rule Call an integration action as bytes or string data type. For more information, see Call an integration.

Note: parseContent does not support large document.

Input Parameters

  • inputContent: String. Content passed in the integration request.

  • loadContentAs: String. Data type in which outputContent field value is passed.

    • bytes. outputContent is generated as bytes.
    • string. outputContent is generated as a string.
  • encoding: String. Type of character set used for encoding inputContent value. This can be any IANA registered character set. Default UTF-8.

    Output Parameters

    • outputContent: Object. Content data corresponds to the data type option set for the loadContentAs field.

Compress Services

Use Compress services to compress the data before sending the HTTP request and decompress it after receiving the HTTP response.

The following Compress services are available:

Service Description
compressData Performs compression of data.
decompressData Performs decompression of data.

compressData

Compresses the data before sending the HTTP request using any of the specified compression schemes.

Input Parameters

  • data: Document - Data that you want the compressData service to compress. Specify data using one of the following keys. When you use more than one key, string is appended first, bytes is appended second, and stream is appended last. IBM webMethods Integration uses the first key that it encounters.

    • string: string Optional - Text that you want the compressData service to compress.
    • bytes: byte[] Optional - Data that you want the compressData service to compress.
    • stream:java.io.InputStream Optional - Data that you want the compressData service to compress.
  • encoding: String. Optional - Name of a registered, IANA character set that specifies the encoding to use when converting the String to an array of bytes (for example: ISO-8859-1).

  • compressionScheme: String - The compression method you want the compressData service to apply to compress the data. The supported compression schemes are gzip and deflate .

  • loadAs: string - Form in which you want the compressData service to store the output data. Set to:

    • bytes to store the data as a byte[].
    • stream to store the data as a java.io.InputStream.

Output Parameters

  • compressedData: Document - Compressed data after applying the compression scheme.

    • bytes: byte[] Conditional - Compressed data represented as a byte[ ]. bytes is returned only when the loadAs input parameter is set to bytes.
    • stream: java.io.InputStream Conditional - Compressed data represented as an InputStream. stream is returned only when the loadAs input parameter is set to stream.

decompressData

Decompresses the data based on the response header of the HTTP response.

Input Parameters

  • data: Document. Data that you want the decompressData service to decompress. Specify data using one of the following keys.

    • bytes: byte[] Optional - Data that you want the decompressData service to decompress.
    • stream: java.io.InputStream Optional - Data that you want the decompressData service to decompress.
  • compressionScheme: String - The compression scheme you want the decompressData service to apply to decompress the data. The supported compression schemes are gzip and deflate .

  • loadAs: string - Form in which you want the decompressData service to store the returned document. Set to:

    • bytes to return the data as a byte[].
    • stream to return the data as a java.io.InputStream.

Output Parameters

  • decompressedData: Document. Decompressed data after applying the compression algorithm.

    • bytes: byte[] Conditional - Decompressed data represented as a byte[]. bytes is returned only when the loadAs input parameter is set to bytes.
    • stream: java.io.InputStream Conditional - The decompressed data represented as an InputStream. stream is returned only when the loadAs input parameter is set to stream.

Date Services

Use Date services to generate and format date values.

Pattern String Symbols - Many of the Date services require you to specify pattern strings describing the data's current format and/or the format to which you want it converted. For services that require a pattern string, use the symbols in the following table to describe the format of your data. For example, to describe a date in the January 15, 1999 format, you would use the pattern string MMMMM dd, yyyy. To describe the format 01/15/99, you would use the pattern string MM/dd/yy.

Symbol Meaning Presentation Example
G era designator Text AD
y year Number 1996 or 96
M month in year Text or Number July or Jul or 07
d day in month Number 10
h hour in am/pm (1-12) Number 12
H hour in day (0-23) Number 0
m minute in hour Number 30
s second in minute Number 55
S millisecond Number 978
E day in week Text Tuesday or Tue
D day in year Number 189
F day of week in month Number 2 (2nd Wed in July)
w week in year Number 27
W week in month Number 2
a am/pm marker Text PM
k hour in day (1-24) Number 24
K hour in am/pm (0-11) Number 0
z time zone Text Pacific Standard Time or PST or GMT-08:00
Z RFC 822 time zone (JVM 1.4 or later) Number -0800 (offset from GMT/UT)
' escape for text Delimiter
' ' single quote Literal '

Time Zones - When working with date services, you can specify time zones. The Earth is divided into 24 standard time zones, one for every 15 degrees of longitude. Using the time zone including Greenwich, England (known as Greenwich Mean Time, or GMT) as the starting point, the time is increased by an hour for each time zone east of Greenwich and decreases by an hour for each time zone west of Greenwich. The time difference between a time zone and the time zone including Greenwich, England (GMT) is referred to as the raw offset.

The following table identifies the different time zones for the Earth and the raw offset for each zone from Greenwich, England. The effects of daylight savings time are ignored in this table.

Note: Greenwich Mean Time (GMT) is also known as Universal Time (UT).
ID Raw Offset Name
MIT -11 Midway Islands Time
HST -10 Hawaii Standard Time
AST -9 Alaska Standard Time
PST -8 Pacific Standard Time
PNT -7 Phoenix Standard Time
MST -7 Mountain Standard Time
CST -6 Central Standard Time
EST -5 Eastern Standard Time
IET -5 Indiana Eastern Standard Time
PRT -4 Puerto Rico and U.S. Virgin Islands Time
CNT -3.5 Canada Newfoundland Time
AGT -3 Argentina Standard Time
BET -3 Brazil Eastern Time
GMT 0 Greenwich Mean Time
ECT +1 European Central Time
CAT +2 Central Africa Time
EET +2 Eastern European Time
ART +2 (Arabic) Egypt Standard Time
EAT +3 Eastern African Time
MET +3.5 Middle East Time
NET +4 Near East Time
PLT +5 Pakistan Lahore Time
IST +5.5 India Standard Time
BST +6 Bangladesh Standard Time
VST +7 Vietnam Standard Time
CTT +8 China Taiwan Time
JST +9 Japan Standard Time
ACT +9.5 Australian Central Time
AET +10 Australian Eastern Time
SST +11 Solomon Standard Time
NST +12 New Zealand Standard Time

Examples - You can specify timezone input parameters in the following formats:

  • As a full name. For example:

    • Asia/Tokyo: America/Los_Angeles

    You can use the java.util.TimeZone.getAvailableIDs() method to obtain a list of the valid full name time zone IDs that your JVM version supports.

  • As a custom time zone ID, in the format GMT[+ | -]hh[ [:]mm]. For example:

    • GMT+2:00: All time zones 2 hours east of Greenwich (that is, Central Africa Time, Eastern European Time, and Egypt Standard Time)
    • GMT-3:00: All time zones 3 hours west of Greenwich (that is, Argentina Standard Time and Brazil Eastern Time)
    • GMT+9:30: All time zones 9.5 hours east of Greenwich (that is, Australian Central Time)
  • As a three-letter abbreviation from the table above. For example:

    • PST: Pacific Standard Time
Note:
  • Three-letter abbreviations > - All three-letter abbreviations are deprecated. This is because some three-letter abbreviations can represent multiple time zones, for example, "CST" could represent both U.S. "Central Standard Time" and "China Standard Time". Hence, use the full name or custom time zone ID formats instead.

  • Invalid DatesThe dates you use with a date service must adhere to the java.text.SimpleDateFormat class. > - If you use an invalid date with a date service, the date service automatically translates the date to a legal date. For example, if you specify 1999/02/30 as input, the date service interprets the date as 1999/03/02 (two days after 2/28/1999). > - If you use 00 for the month or day, the date service interprets 00 as the last month or day in the Gregorian calendar. For example, if you specify 00 for the month, the date service interprets it as 12. > If the pattern yy is used for the year, the date service uses a 50-year moving window to interpret the value of yy. The date service establishes the window by subtracting 49 years from the current year and adding 50 years to the current year. For example, if you are running IBM webMethods Integration in the year 2000, the moving window would be from 1951 to 2050. The date service interprets 2-digit years as falling into this window (for example, 12 would be 2012, 95 would be 1995).

The following Date services are available:

Service Description
calculateDateDifference Calculates the difference between two dates and returns the result as seconds, minutes, hours, and days.
compareDates Compares two dates and returns the result as integer.
currentNanoTime Returns the current value of the running Java Virtual Machine's high-resolution time source, in nanoseconds.
dateBuild Builds a date String using the specified pattern and the specified date services.
dateTimeBuild Builds a date/time string using the specified pattern and the specified date services.
dateTimeFormat Converts date/time (represented as a String) string from one format to another.
elapsedNanoTime Calculates the time elapsed between the current time and the given time, in nanoseconds.
formatDate Formats a Date object as a string.
getCurrentDate Returns the current date as a Date object.
getCurrentDateString Returns the current date as a String in a specified format.
incrementDate Increments a date by a specified period.

calculateDateDifference

Calculates the difference between two dates and returns the result as seconds, minutes, hours, and days.

Input Parameters

  • startDate: String - Starting date and time.

  • endDate: String - Ending date and time.

  • startDatePattern: String - Format in which the startDate parameter is to be specified (for example, yyyyMMdd HH:mm:ss.SSS).

  • endDatePattern: String - Format in which the endDate parameter is to be specified (for example, yyyyMMdd HH:mm:ss.SSS).

Output Parameters

  • dateDifferenceSeconds: String - The difference between the startingDateTime and endingDateTime, truncated to the nearest whole number of seconds.

  • dateDifferenceMinutes: String - The difference between the startingDateTime and endingDateTime, truncated to the nearest whole number of minutes.

  • dateDifferenceHours: String - The difference between the startingDateTime and endingDateTime, truncated to the nearest whole number of hours.

  • dateDifferenceDays: String - The difference between the startingDateTime and endingDateTime, truncated to the nearest whole number of days.

Usage Notes

Each output value represents the same date difference, but in a different scale. Do not add these values together. Make sure your subsequent flow service steps use the correct output, depending on the scale required.

compareDates

Compares two dates and returns the result as an integer.

Input Parameters

  • startDate: String - Starting date to compare against endDate.

  • endDate: String - Ending date to compare against startDate.

  • startDatePattern: String - Format in which the startDate parameter is specified (for example, yyyyMMdd HH:mm:ss.SSS).

  • endDatePattern: String - Format in which the endDate parameter is specified (for example, yyyyMMdd HH:mm:ss.SSS).

Output Parameters

  • result: String. Checks whether startDate is before, the same, or after the endDate based on the values as follows:

    • +1: The startDate is after the endDate.
    • 0: The startDate is the same as the endDate.
    • -1: The startDate is before the endDate.

Usage Notes

If the formats specified in the startDatePattern and endDatePattern parameters are different, IBM webMethods Integration takes the units that are not specified in the startDate and endDate values as 0.

That is, if the startDatePattern is yyyyMMdd HH:mm and the startDate is 20151030 11:11 and if the endDatePattern is yyyyMMdd HH:mm:ss.SSSand the endDate is 20151030 11:11:55:111, then the compareDates service considers start date to be before the end date and will return the result as -1.

To calculate the difference between two dates, use the calculateDateDifference service.

currentNanoTime

Returns the current value of the running Java Virtual Machine's high-resolution time source, in nanoseconds. This method can only be used to measure elapsed time and is not related to any other notion of system or wall-clock time. The value returned represents nanoseconds since some fixed but arbitrary origin time (perhaps in the future, so values may be negative). Use this service in-conjunction with elapsedNanoTime service.

Input Parameters

None.

Output Parameters

  • nanoTime: java.lang.Long - The value returned represents the time elapsed since an arbitrary fixed point in nanoseconds, which is not necessarily related to the actual current date and time.

dateBuild

Builds a date String using the specified pattern and the specified date services.

Input Parameters

  • pattern: String - Pattern representing the format in which you want the date returned. If you do not specify pattern, dateBuild returns null. If pattern contains a time zone and timezone is not specified, the default time zone is used.

  • year: String Optional - The year expressed in yyyy or yy format (for example, 01 or 2001). If you do not specify year or you specify an invalid value, dateBuild uses the current year.

  • month: String Optional - The month expressed as a number (for example, 1 for January, 2 for February). If you do not specify month or you specify an invalid value, dateBuild uses the current month.

  • dayofmonth: String Optional - The day of the month expressed as a number (for example, 1 for the first day of the month, 2 for the second day of the month). If you do not specify dayofmonth or you specify an invalid value, dateBuild uses the current day.

  • timezone: String Optional - Time zone in which you want the output date and time expressed. Specify a time zone code as shown in the “Time Zones” section, for example, EST for Eastern Standard Time. If you do not specify timezone, the value of the server's "user timezone" property is used. If this property has not been set, GMT is used.

  • locale: String Optional - Locale in which the date is to be expressed. For example, if locale is en (for English), the pattern EEE d MMM yyyy will produce Friday 23 August 2002, and the locale of fr (for French) will produce vendredi 23 août 2002.

Output Parameters

  • value: String - The date specified by year, month, and dayofmonth, in the format of pattern.

dateTimeBuild

Builds a date/time string using the specified pattern and the specified date services.

Input Parameters

  • pattern: String - Pattern representing the format in which you want the time returned. For pattern-string notation, see the “Pattern String Symbols” section. If you do not specify pattern, dateTimeBuild returns null. If pattern contains a time zone and the timezone parameter is not set, the default time zone is used.

  • year: String Optional - The year expressed in yyyy or yy format (for example, 01 or 2001). If you do not specify year or you specify an invalid value, dateTimeBuild uses the current year.

  • month: String Optional - The month expressed as a number (for example, 1 for January, 2 for February). If you do not specify month or you specify an invalid value, dateTimeBuild uses the current month.

  • dayofmonth: String Optional - The day of the month expressed as a number (for example, 1 for the first day of the month, 2 for the second day of the month). If you do not specify dayofmonth or you specify an invalid value, dateTimeBuild uses the current day.

  • hour: String Optional - The hour expressed as a number based on a 24-hour clock. For example, specify 0 for midnight, 2 for 2:00 A.M., and 14 for 2:00 P.M. If you do not specify hour or you specify an invalid value, dateTimeBuild uses 0 as the hour value.

  • minute: String Optional - Minutes expressed as a number. If you do not specify minute or you specify an invalid value, dateTimeBuild uses 0 as the minute value.

  • second: String Optional - Seconds expressed as a number. If you do not specify second or you specify an invalid value, dateTimeBuild uses 0 as the second value.

  • millis: String Optional - Milliseconds expressed as a number. If you do not specify millis or you specify an invalid value, dateTimeBuild uses 0 as the millis value.

  • timezone: String Optional - Time zone in which you want the output date and time expressed. Specify a time zone code as shown in the “Time Zones” section, for example, EST for Eastern Standard Time. If you do not specify timezone, the value of the server's "user timezone" property is used. If this property has not been set, GMT is used.

  • locale: String Optional - Locale in which the date is to be expressed. For example, if locale is en (for English), the pattern EEE d MMM yyyy will produce Friday 23 August 2002, and the locale of fr (for French) will produce vendredi 23 août 2002.

Output Parameters

  • value: String - Date and time in format of pattern.

dateTimeFormat

Converts date/time (represented as a String) string from one format to another.

Input Parameters

  • inString: String - Date/time that you want to convert. Important: If inString contains a character in the last position, that character is interpreted as 0. This can result in an inaccurate date. For information about invalid dates, see the “Notes on Invalid Dates” section.

  • currentPattern: String - Pattern string that describes the format of inString.

  • newPattern: String - Pattern string that describes the format in which you want inString returned.

  • locale: String Optional - Locale in which the date is to be expressed. For example, if locale is en (for English), the pattern EEE d MMM yyyy will produce Friday 23 August 2002, and the locale of fr (for French) will produce vendredi 23 août 2002.

  • lenient: String Optional - A flag indicating whether an exception will appear if the inString value does not adhere to the format specified in currentPattern parameter. Set to:

    • true to perform a lenient check. This is the default. In a lenient check, if the format of the date specified in the inString parameter does not match the format specified in the currentPattern parameter, the date in the format specified in the currentPattern parameter will be interpreted and returned. If the interpretation is incorrect, the service will return an invalid date.

    • false to perform a strict check. In a strict check, an exception will appear if the format of the date specified in the inString parameter does not match the format specified in the currentPattern parameter.

Output Parameters

  • value: String - The date/time given by inString, in the format of newPattern.

Usage Notes

As described in the “Notes on Invalid Dates" section, if the pattern yy is used for the year, dateTimeFormat uses a 50-year moving window to interpret the value of the year.

If currentPattern does not contain a time zone, the value is assumed to be in the default time zone.

If newPattern contains a time zone, the default time zone is used.

elapsedNanoTime

Calculates the time elapsed between the current time and the given time, in nanoseconds.

Input Parameters

  • nanoTime: java.lang.Long - Time in nanoseconds. If nanoTime is less than zero, then the service treats it as zero.

Output Parameters

  • elapsedNanoTime: java.lang.Long - The difference between the current time in nanoseconds and nanoTime. If nanoTime is greater than the current nano time, the service returns zero.

  • elapsedNanoTimeStr: String - The difference between the current time in nanoseconds and nanoTime. The difference is expressed as a String, in this format: [years] [days] [hours] [minutes] [seconds] [millisec] [microsec] <nanosec>. If nanoTime is greater than the current nano time, the service returns zero.

formatDate

Formats a Date object as a string.

Input Parameters

  • date: java.util.Date Optional - Date/time that you want to convert.

  • pattern: String - Pattern string that describes the format in which you want the date returned.

  • timezone: String Optional - Time zone in which you want the output date and time expressed. Specify a time zone code as shown in the Time Zones section, for example, EST for Eastern Standard Time. If you do not specify timezone, the user's time zone is used, else GMT is used.

  • locale: String Optional - Locale in which the date is to be expressed. For example, if locale is en (for English), the pattern EEE d MMM yyyy will produce Friday 23 August 2002, and the locale of fr (for French) will produce vendredi 23 août 2002.

Output Parameters

  • value: String - The date/time given by date in the format specified by pattern.

getCurrentDate

Returns the current date as a Date object.

Input Parameters

None.

Output Parameters

  • date: java.util.Date - Current date.

getCurrentDateString

Returns the current date as a String in a specified format.

Input Parameters

  • pattern: String - Pattern representing the format in which you want the date returned.

  • timezone: String Optional - Time zone in which you want the output date and time expressed. Specify a time zone code as shown in the “Time Zones” section, for example, EST for Eastern Standard Time. If you do not specify timezone, the value of the server's "user timezone" property is used. If this property has not been set, GMT is used. Alternatively, you can also specify the timezone as a full name.

    For regions where Daylight Saving Time (DST) is observed, use the full name of the timezone for accurate time representation. For example, specifying the EST timezone code yields the current time as Eastern Standard Time without applying DST. To obtain Eastern Standard Time with DST adjustment, use America/New_York.

  • locale: String Optional - Locale in which the date is to be expressed. For example, if locale is en (for English), the pattern EEE d MMM yyyy will produce Friday 23 August 2002, and the locale of fr (for French) will produce vendredi 23 août 2002.

Output Parameters

  • value: String - Current date in the format specified by pattern.

incrementDate

Increments a date by a specified amount of time.

Input Parameters

  • startDate: String - Starting date and time.

  • startDatePattern: String - Format in which the startDate parameter is specified (for example, yyyyMMdd HH:mm:ss.SSS).

  • endDatePattern: String Optional - Pattern representing the format in which you want the endDate to be returned. If no endDatePattern is specified, the endDate will be returned in the format specified in the startDatePattern parameter.

  • addYears: String Optional - Number of years to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addMonths: String Optional - Number of months to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addDays: String Optional - Number of days to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addHours: String Optional - Number of hours to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addMinutes: String Optional - Number of minutes to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addSeconds: String Optional - Number of seconds to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addMilliSeconds: String Optional. Number of milliseconds to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • timezone: String Optional - Time zone in which you want the endDate to be expressed. Specify a time zone code, for example, EST for Eastern Standard Time. If you do not specify timezone, the value of the server's "user timezone" property is used. If this property has not been set, GMT is used.

  • locale: String Optional - Locale in which the endDate is to be expressed. For example, if locale is en (for English), the pattern EEE d MMM yyyy will produce Friday 23 August 2002, and the locale of fr (for French) will produce vendredi 23 août 2002.

Output Parameters

  • endDate: String - The end date and time, calculated by incrementing the startDate with the specified years, months, days, hours, minutes, seconds, and/or milliseconds. The endDate will be in the endDatePattern format, if specified. If no endDatePattern is specified or if blank spaces are specified as the value, the endDate will be returned in the format specified in the startDatePattern parameter.

Usage Notes

The addYears, addMonths, addDays, addHours, addMinutes, addSeconds, and addMilliSeconds input parameters can take positive or negative values. For example, If startDate is 10/10/2001, startDatePattern is MM/dd/yyyy, addYears is 1, and addMonths is -1, endDate will be 09/10/2002.

If you specify only the startDate, startDatePattern, and endDatePattern input parameters and do not specify any of the optional input parameters to increment the period, the incrementDate service just converts the format of startDate from startDatePattern to endDatePattern and returns it as endDate.

The format of the date specified in the startDate parameter must match the format specified in the startDatePattern and the format of the date specified in the endDate parameter must match the endDatePattern format.

Datetime Services

Use Datetime services to build or increment a date/time. The services in datetime provide more explicit timezone processing than similar services in the date category.

Providing Time Zones

You can specify timezone input parameters to the datetime services in the following formats:

  • As a full name.

    Example: Asia/Tokyo America/Los_Angeles

    You can use java.time.ZoneId.getAvailableZoneIds. () method to obtain a list of the valid full name time zone IDs that your JVM version supports.

  • As UTC.

    Example: UTC - 5h

  • As a custom time zone ID, in the format GMT[+ | -]hh[ [:]mm].

    Example: GMT+2:00 Time zones 2 hours east of Greenwich GMT-3:00 Time zones 3 hours west of Greenwich (that is, Argentina Standard Time and Brazil Eastern Time)

    GMT+9:30 Time zones 9.5 hours east of Greenwich (that is, Australian Central Time)

  • As a three-letter abbreviation.

    Example: PST Pacific Standard Time

    Important: As some three-letter abbreviations can represent multiple time zones (for example, "CST" could represent both U.S. "Central Standard Time" and "China Standard Time"), all abbreviations are deprecated. Use the full name, UTC, or custom time zone ID GMT formats instead.

The following Datetime services are available:

Service Description
build Builds a date/time string using the specified pattern and the supplied date/time elements.
increment Increments or decrements a date and time by a specified amount of time.

build

Builds a date/time string using the specified pattern and the supplied date/time elements.

Input Parameters

  • pattern: String - The pattern with which to format the string. For more information about these pattern letters and symbols, see the Oracle Java API documentation for the DateTimeFormatter class.

  • year: String Optional - The year expressed as a 4-digit Integer. If you do not specify year, the year will be from the current date which is determined by the JVM in which IBM webMethods Integration runs. If you specify an invalid value for year, the service will end with an error from the JDK.

  • month: String Optional - The month expressed as an Integer where January is 1. If you do not specify month, the month will be from the current date which is determined by the JVM in which IBM webMethods Integration runs. If you specify an invalid value for month, the service will end with an error from the JDK.

  • dayOfMonth: String Optional - The day of the month expressed as an Integer, starting with 1 as the first day of the month. If you do not specify dayOfMonth, the day of the month will be from the current date which is determined by the JVM in which IBM webMethods Integration runs. If you specify an invalid value for day, the service will end with an error from the JDK.

  • hour: String Optional - The hour of the day expressed as an Integer from 0 through 23. If you do not specify hour, the hour will be from the current time which is determined by the JVM in which IBM webMethods Integration runs. If you specify an invalid value for hour, the service will end with an error from the JDK.

  • minute: String Optional - The minute expressed as an Integer from 0 through 59. If you do not specify minute, the minute will be from the current time which is determined by the JVM in which IBM webMethods Integration runs. If you specify an invalid value for minute, the service will end with an error from the JDK.

  • second: String Optional - The seconds of the hour expressed as an Integer from 0 through 59. If you do not specify second, the second will be from the current time which is determined by the JVM in which IBM webMethods Integration runs. If you specify an invalid value for second, the service will end with an error from the JDK.

  • millis: String Optional - The number of milliseconds expressed as a Long. If you do not specify millis, the millis will be from the current time which is determined by the JVM in which IBM webMethods Integration runs. If you specify an invalid value for millis, the service will end with an error from the JDK.

  • timezone: String Optional - The time zone. If you specify a value for timezone, the service ignores the useSystemTimeZone parameter value. It is recommended to supply the full name for timezones, such as Asia/Tokyo, or use UTC. If pattern includes a timezone, you must specify timezone input parameter value or set useSystemTimeZone to true.

  • useSystemTimeZone: String Optional - Indicates whether the service uses the time zone of the IBM webMethods Integration JVM if timezone was not specified. Set to:

    • true to use the time zone of IBM webMethods Integration when timezone is not specified.

    • false if you do not want the service to use the timezone of IBM webMethods Integration if timezone was not set. The default is false.

    If pattern includes a timezone, you must specify the timezone input parameter value or set useSystemTimeZone to true.

    To match the behavior of date:dateTimeBuild which produced a date/time that always included a time zone set useSystemTimeZone to true. This ensures that if timezone is not specified, the resulting date/time will include a time zone.

  • locale: String Optional - The locale in which to express the date.

Output Parameters

  • value: String - The formatted date and time.

Usage Notes

The build service replaces the date:dateBuild and date:dateTimeBuild services which are deprecated.

If you specify a parameter that does not exist in the supplied pattern, the service ignores that parameter.

If you do not specify a timezone, useSystemTimeZone is set to false, and the pattern includes a time zone, the service ends with an exception.

If a time zone is provided as input to the service either in the timezone parameter or by setting useSystemTimeZone to true, the build service calculates the date/time starting with a "zoned" date/time. The resulting values can differ when daylight savings time transitions are in effect. If no time zone is provided as input to the service either by not specifying timezone or by setting useSystemTimeZone to false, then the build service calculates the date/time starting with an "unzoned" date/time.

The build service is similar to date:dateBuild and date:dateTimeBuild, however, the build service allows the building of a date/time that does not include a time zone. Furthermore, the build service assembles a date/time using each of the provided parameters. Consequently the build service can build a date/time with a value that would be invalid in the current time zone, such as a date/time that would fall into the gap of a daylight saving time transition. This is unlike the date:dateBuild and date:dateTimeBuild services which build a local java.util.Date object that uses the timezone of the machine running IBM webMethods Integration. The date:dateBuild and date:dateTimeBuild service then applies the offset between the local timezone and the specified timezone.

increment

Increments or decrements a date and time by a specified amount of time.

Input Parameters

  • startDate: String - Starting date and time.

  • startDatePattern: String - Pattern in which the startDate value is specified. For more information about these pattern letters and symbols, see the Oracle Java API documentation for the DateTimeFormatter class.

  • endDatePattern: String - Pattern in which to format the resulting date/time. For more information about these pattern letters and symbols, see the Oracle Java API documentation for the DateTimeFormatter class. If no endDatePattern is specified, the endDate will be returned in the format specified in the startDatePattern parameter.

  • timezone: String Optional - The time zone to use for parsing startDate and formatting endDate. The service uses timezone to parse the startDate String and convert it from the time zone specified in the input, if one was provided. For example, if the timezone input parameter is MST and the startDate is "2019-02-21 11:30:00 EST", then the service converts the startDate time from EST to MST. The service uses timezone when formatting endDate as a String. That is, the timezone determines the time zone in which the service expresses the endDate.

  • locale: String Optional - Locale in which the endDate is to be expressed.

  • addYears: String Optional - The number of years to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addMonths: String Optional - The number of months to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addDays: String Optional - The number of days to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addHours: String Optional - The number of hours to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addMinutes: String Optional - The number of minutes to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addSeconds: String Optional - The number of seconds to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • addMilliseconds: String Optional - The number of milliseconds to add to startDate. The value must be an integer between -2147483648 and 2147483647.

  • useSystemTimeZone: String Optional - Whether to use the system time zone to increment the date/time when the startDate value does not have a time zone. Set to:

    • false if the startDate does not include a time zone, the timezone parameter was not set, and you want to increment the date/time without being affected by a time zone. This is the default.

    • true to use the system time zone when incrementing the startDate.

    When useSystemTimeZone is false and no timezone is provided, the resulting endDate will not include a timezone. To match the behavior of date:incrementDate, which produced a date/time that always included a time zone, set useSystemTimeZone to true.|

  • useSameInstant: String Optional - Whether to use the same Instant, where Instant represents a moment on the timeline in UTC, or the same unzoned date/time when applying a different time zone. Using the same Instant will usually result in changes to the unzoned date/time when the time zone and its offset are applied. Not using the same Instant will result in the unzoned date/time being unchanged when the time is applied. If useSameInstant is true, the increment service uses the Instant (the absolute time with no time zones) to determine how the timezone value is used.

    If useSameInstant is false, the increment service uses the unzoned date/time and only changes the time zone. The default is true.

Note: For the purpose of this documentation, the term "unzoned date/time" is synonymous with the term "local date/time".
For example, if startDate is a date/time of "2019-02-25 08:25:00 CET" (Central European Time, UTC+1:00) and the specified timezone value is America/New_York (EST, UTC-5:00) , the value of useSameInstant has the following impact:
  • If useSameInstant is true, then 2019-02-25 08:25:00 CET becomes 2019-02-25 02:25:00 EST
  • If useSameInstant is false, then 2019-02-25 08:25:00 CET becomes 2019-02-25 08:25:00 EST

Output Parameters

  • endDate: String - The incremented date and time.

Usage Notes

The increment service replaces the date:incrementDate service which is deprecated.

The increment service can be used to decrement a date and time by specifying negative numbers. The addYears , addMonths , addDays , addHours , addMinutes , addSeconds , and addMilliSeconds input parameters can take positive or negative values.

The service ends with an exception if the format of the date specified in the startDate parameter does not match the format specified in the startDatePattern.

If endDatePattern includes a time zone, such as "z", then the input string and startDatePattern must also have time zone fields, or timeZone must be set, or useSystemTimeZone must be true. Otherwise the service ends with an error.

If you specify only the startDate, startDatePattern, and endDatePattern input parameters and do not specify any of the optional input parameters to increment the period, the increment service just converts the format of startDate from startDatePattern to endDatePattern and returns it as endDate.

If you specify a value for timezone, the service ignores the useSystemTimeZone parameter value.

If you specify a value for timezone and the startDate includes a time zone, then the service uses the supplied timezone to convert the startDate time zone.

If you do not specify a value for timezone and the startDate includes a time zone, then the service uses the time zone in the startDate and ignores the useSystemTimeZone parameter.

If you do not specify a value for timezone, the startDate does not include a time zone, and useSystemTimeZone parameter is true, then the service uses the system time zone.

If startDate does not include a time zone, you do not specify a value for timezone, and useSystemTimeZone is false, the resulting endDate will not include a time zone.

The increment service is similar to date:incrementDate, however, the increment service provides more specific handling of time zones. To match the behavior of date:incrementDate, set useSameInstant to true.

Document Services

Use Document services to perform operations on documents.

The following Document services are available:

Service Description
bytesToDocument Converts an array of bytes to a document.
deleteDocuments Deletes the specified documents from a set of documents.
documentListToDocument Constructs a document from a document list by generating key/value pairs from the values of two elements that you specify in the document list.
documentToBytes Converts a document to an array of bytes.
documentToDocumentList Expands the contents of a document into a list of documents. Each key/value pair in the source document is transformed to a single document containing two keys (whose names you specify). These two keys will contain the key name and value of the original pair.
findDocuments Searches a set of documents for entries matching a set of Criteria.
groupDocuments Groups a set of documents based on specified criteria.
insertDocument Inserts a new document in a set of documents at a specified position.
removeNullFields Removes null fields from a given document.
searchDocuments Searches a set of documents for entries matching a set of Criteria.
sortDocuments Sorts a set of input documents based on the specified sortCriteria.

bytesToDocument

Converts an array of bytes to a document. This service can only be used with byte arrays created by executing the documentToBytes service.

Input Parameters

  • documentBytes: Object - An array of bytes (byte[]) to convert to a document.

    • If documentBytes is null, the service does not return a document or an error message.

    • If documentBytes is not a byte array, the service throws an exception.

    • If documentBytes is zero-length, the service produces an empty document.

Output Parameters

  • document: Document - A document.

Usage Notes

Use this service with the documentToBytes service, which converts a document into a byte array. You can pass the resulting byte array to the bytesToDocument service to convert it back into the original document.

In order for the document-to-bytes-to-document conversion to work, the entire content of the document must be serializable. Every object in the document must be of a data type known to IBM webMethods Integration, or it must support the java.io.Serializable interface.

If IBM webMethods Integration encounters an unknown object in the document that does not support the java.io.Serializable interface, that object's value will be lost. It will be replaced with a string containing the object's class name.

deleteDocuments

Deletes the specified documents from a set of documents.

Input Parameters

  • documents: Document List - Set of documents that contain the documents you want to delete.

  • indices: String List - Index values of documents to be deleted from the documents parameter document list.

Output Parameters

  • documents: Document List - List of documents whose indices do not match the values in indices parameter.

  • deletedDocuments: Document List - List of deleted documents.

Usage Notes

The deleteDocuments service returns an error if the indices parameter value is less than zero or more than the number of documents in the documents input parameter.

documentListToDocument

Constructs a document from a document list by generating key/value pairs from the values of two elements that you specify in the document list.

Input Parameters

  • documentList: Document List - Set of documents that you want to transform into a single document.
Note: If the documentList parameter contains a single document instead of a Document List, the documentListToDocument service does nothing.
  • name: String - Name of the element in the documentList parameter whose value provides the name of each key in the resulting document.
Important: The data type of the element that you specify in the name parameter must be String.
  • value: String - Name of the element in the documentList parameter whose values will be assigned to the keys specified in name. This element can be of any data type.

Output Parameters

  • document: - Document Document containing the key/value pairs generated from the documentList parameter.

Usage Notes

The following example illustrates how the documentListToDocument service would convert a document list that contains three documents to a single document containing three key/value pairs. When you use the documentListToDocument service, you specify which two elements from the source list are to be transformed into the keys and values in the output document. In the following example, the values from the pName elements in the source list are transformed into key names, and the values from the pValue elements are transformed into the values for these keys.

A documentList containing these three documents:

Key Value
pName cx_timeout
pValue 1000
Key Value
pName cx_max
pValue 2500
Key Value
pName cx_min
pValue 10

Would be converted to a document containing these three keys:

Key Value
cx_timeout 1000
cx_max 2500
cx_min 10

documentToBytes

Converts a document to an array of bytes.

Input Parameters

  • document: Document - Document to convert to bytes.

    • If document is null, the service does not return an output or an error message.

    • If document is not a document, the service throws an exception.

    • If document contains no elements, the service produces a zero-length byte array.

Output Parameters

  • documentBytes: Object - A serialized representation of the document as an array of bytes (byte[]).

Usage Notes

Use the documentToBytes service with the bytesToDocument service, which converts the byte array created by this service back into the original document.

The documentToBytes service is useful when you want to write a document to a file, an input stream, or a cache.

In order for the document-to-bytes-to-document conversion to work, the entire content of the document must be serializable. Every object in the document must be of a data type known to IBM webMethods Integration, or it must support the java.io.Serializable interface. If IBM webMethods Integration encounters an unknown object in the document that does not support the java.io.Serializable interface, that object's value will be lost. IBM webMethods Integration will replace it with a string containing the object's class name.

documentToDocumentList

Expands the contents of a document into a list of documents.

Each key/value pair in the source document is transformed to a single document containing two keys (whose names you specify). These two keys will contain the key name and value of the original pair.

Input Parameters

  • document: Document - Document to transform.

  • name: String - Name to assign to the key that will receive the key name from the original key/value pair. In the example above, this parameter was set to pName.

  • value: String - Name to assign to the key that will receive the value from the original key/value pair. In the example above, this parameter was set to pValue.

Output Parameters

  • documentList: Document List - List containing a document for each key/value pair in the document parameter. Each document in the list will contain two keys, whose names were specified by the name and value parameters. The values of these two keys will be the name and value (respectively) of the original pair.

Usage Notes

The following example shows how a document containing three keys would be converted to a document list containing three documents. In this example, the names pName and pValue are specified as names for the two new keys in the document list.

A document containing these three keys:

Key Value
cx_timeout 1000
cx_max 2500
cx_min 10

Would be converted to a document list containing these three documents:

Key Value
pName cx_timeout
pValue 1000
Key Value
pName cx_max
pValue 2500
Key Value
pName cx_min
pValue 10

findDocuments

Searches a set of documents for entries matching a set of criteria.

Input Parameters

  • documents: Document List - Set of documents from which the documents meeting the retrieve criteria are to be returned.

  • matchCriteria: Document - Criteria on which the documents in the documents parameter are to be matched. Parameters for matchCriteria are: path: Name of the element in documentList whose value provides the value for the search text. The value for key can be a path expression. For example, "Family/Chidren[0]/ BirthDate" retrieves the birthday of the first child from the input Family document list.

    • compareValueAs Optional - Allowed values are string, numeric, and datetime. The default value is string.

    • datePattern Optional - Pattern will be considered only if compareValueAs is of type datetime. Default value is MM/dd/yyyy hh:mm:ss a.

    • joins - List of join criteria. Each join criteria consists of:

      operator - Allowed values are equals, doesNotEqual, greaterThan, greaterThanEqual, lessThan, lessThanEqual, equalsIgnoreCase, contains, doesNotContain, beginsWith, doesNotBeginWith, endsWith, doesNotEndWith.

      value Optional - Allowed values are string, numeric, and datetime. The default value is string.

      joinType - Specifies the way two joins can be linked. Values are “and” or “or”. Default value is “and”.

Output Parameters

  • result documents: Document List - List of documents that match the retrieve criteria.

groupDocuments

Groups a set of documents based on specified criteria.

Input Parameters

  • documents: Document List - Set of documents to be grouped based on the specified criteria.

  • groupCriteria: Document List - The criteria on which the input documents are to be grouped. Valid values for the groupCriteria parameter are:

    • key - Key in the pipeline. The value for key can be a path expression. For example, "Family/Chidren[0]/BirthDate" retrieves the birthday of the first child from the input Family document list.

    • compareStringsAs. Optional - Valid values for compareStringsAs are string, numeric, and datetime. The default value is string.

    • pattern. Optional - Pattern will be considered only if the compareStringsAs parameter is of type datetime.

Note: If key is not found in all the input documents, the documents that do not match the groupCriteria are grouped together as a single group.

Output Parameters

  • documentGroups: Document List - List of documents where each element represents a set of documents grouped based on the criteria specified.

Usage Notes

The following example illustrates how to specify the values for the groupCriteria parameter:

key compareStringsAs pattern
name string
age numeric
birthdate datetime yyyy-MM-dd

The input documents will be grouped based on name, age, and birth date.

insertDocument

Inserts a new document in a set of documents at a specified position.

Input Parameters

  • documents: Document List - Set of documents in which a new document is to be inserted.

  • insertDocument: Document. The new document to be inserted to the set of documents specified in the documents parameter.

  • index: String. Optional. The position in the seat which the document is to be inserted. The index parameter is zero-based. if the value for the index parameter is not specified, the document will be inserted at the end of the document list specified in the documents parameter.

Output Parameters

  • documents: Document List. Document list after inserting the new document.

removeNullFields

Removes null fields from a given document. Optionally, by specifying trimStringFields and removeEmptyStringFields, you can trim leading and trailing spaces in a string field, and after trimming the fields, if the string field length is zero, they can be removed. For array fields, it reduces the size of the array by the number of null fields. After removing all the null fields, if the size is zero, the array field is removed from the given document.

Note: Use this operation carefully as it is a destruction operation and removes the fields from the given document. For trimming string fields, a space character is defined as any character whose codepoint is less than or equal to U+0020 (the space character).

Input Parameters

  • document: Documents. A document from where fields having value null are removed.

  • trimStringFields: If specified, for fields whose type is String, would remove the leading and trailing space characters. Default value is false.

  • removeEmptyStringFields: If specified, if a string field is empty, it is removed from the given document. If both trimStringFields and removeEmptyStringFields are true, then after removing the spaces, if there are no characters in the string, it is removed from the document. Default value is false.

Output Parameters

  • document: Document. Returns the document having non-null fields.

searchDocuments

Searches a set of documents for entries matching a set of Criteria.

Input Parameters

  • documents: Document List. Set of documents from which the documents meeting the search criteria are to be returned.

  • searchCriteria: Document. Criteria on which the documents in the documents parameter are to be searched. Valid values for searchCriteria parameters are:

    • key: Name of the element in documentList whose value provides the value for the search text. The value for key can be a path expression. For example, Family/Chidren[0]/BirthDate retrieves the birthday of the first child from the input Family document list.

    • value: Optional. Any search text. If no value is specified, the service searches for null in the document list.

    • compareStringsAs: Optional. Allowed values are string, numeric, and datetime. The default value is string.

    • pattern: Optional. Pattern will be considered only if the compareStringsAs value is of type datetime.

  • sorted: String Optional - The value of the sorted parameter is true if the document list is already sorted based on the search criteria and same search key; otherwise false. If the value for the sorted parameter is set to true, the required documents are searched faster.

Output Parameters

  • resultdocuments: Document List - List of documents which are matching the search criteria.

  • documentListIndices: String List - Positions of search documents in the document list.

  • documents: Document List - List of documents that were input.

Usage Notes

For example, if you want to search a set of documents for documents where BirthDate is 10th January 2008, the values for the searchCriteria parameter would be:

key value compareStringsAs pattern
Birthdate 2008-01-10 datetime yyyy-MM-dd

sortDocuments

Sorts a set of input documents based on the specified sortCriteria.

Input Parameters

  • documents: Document List - Set of documents that are to be sorted.

  • sortCriteria: Document List - Criteria based on which the documents in the documents parameter are to be sorted. Valid values for sortCriteria parameters are:

    • key -. Name of the element in documentList whose value provides the value based on which the documents are to be sorted. The value for key can be a path expression. For example, "Family/Chidren[0]/BirthDate" retrieves the birthday of the first child from the input Family document list.
    • order: Optional - Allowed values are ascending and descending. The default value is ascending.
    • compareStringsAs: Optional - Allowed values are string, numeric, and datetime. Default value is string.
    • pattern: Optional - The value for pattern will be considered only if the compareStringsAs value is of type datetime.
Note: If key is not found in all the input documents, the sorted list of documents appears at the end or start of the list based on the order specified. If the order is ascending, then all the documents that do not match the sort criteria appears at the top of the list, followed by the sorted list. If the order is descending, the sorted list will appear at the top, followed by the documents that do not match the sort criteria.

Output Parameters

  • documents: Document List - The documents sorted based on the sort criteria specified in the sortCriteria parameter.

Usage Notes

For example, if you want to sort a set of documents based on name, age, and then on birth date, the values for sortCriteria parameter would be:

key order compareStringsAs pattern
Name ascending string  
Age descending numeric  
Birthdate ascending datetime yyyy-MM-dd

Flat File Services

Use Flat File services to convert data bytes, data stream, and data string to a document and vice versa.

The following Flat File services are available:

Service Description
delimitedDataBytesToDocument Converts delimited data bytes (byte array) to a document.
delimitedDataStreamToDocument Converts delimited data stream to a document.
delimitedDataStringToDocument Converts delimited data string to a document.
documentToDelimitedDataBytes Converts a document to delimited data bytes (byte array object).
documentToDelimitedDataStream Converts a document to a delimited data stream.
documentToDelimitedDataString Converts a document to a delimited data string.

delimitedDataBytesToDocument

Converts delimited data bytes (byte array) to a document.

Input Parameters

  • delimitedDataBytes: java.lang.Byte[] - Delimited data in bytes (Byte array) to convert to a document.
  • fieldQualifier: String Optional - The delimiter to use for separating entries in delimitedDataBytes. Default is comma (,).
  • textQualifier: String Optional - The character to use for quoted elements. Default is double quote (").
  • useHeaderRowForFieldNames: String Optional - Consider first line as header row and use the delimited data of this line as property names in the output document.

    Set to:

    • true - The delimited data of first line will be used as the property name in the output document. This is the default.
    • false - column1, column2...columnN will be used as the property name in the output document.
  • skipBOMBytes: Optional - The default value is False. Set the parameter to True to ensure proper file parsing and avoid integration issues. When the value is set to true, it automatically skips the ByteOrderMark bytes from the input stream which includes an encoded ByteOrderMark as its first bytes.

  • encoding: String Optional - The encoding to use while parsing the delimited data.

Output Parameters

  • document: Document - Document resulting from the conversion of delimitedDataBytes. This document contains document array rows[] corresponding to the delimited data.

delimitedDataStreamToDocument

Converts delimited data stream to a document. The permissible size of the content stream is based on your tenancy.

Input Parameters

  • delimitedDataStream: java.io.InputStream - Delimited data in an input stream to convert to a document.
  • fieldQualifier: String Optional - The delimiter to use for separating entries in delimitedDataStream. Default is comma (,).
  • textQualifier: String Optional - The character to use for quoted elements. Default is double quote (").
  • useHeaderRowForFieldNames: String Optional - Consider first line as header row and use the delimited data of this line as property names in the output document.

    Set to:

    • true - The delimited data of first line will be used as the property name in the output document. This is the default.
    • false - column1, column2...columnN will be used as the property name in the output document.
  • skipBOMBytes: Optional - Automatically skips the ByteOrderMark bytes from the input stream which includes an encoded ByteOrderMark as its first bytes.
  • encoding: String Optional - The encoding to use while parsing the delimited data.

Output Parameters

  • document: Document - Document resulting from the conversion of delimitedDataStream. This document contains document array rows[] corresponding to the delimited data.

delimitedDataStringToDocument

Converts delimited data string to a document.

Input Parameters

  • delimitedDataString: String - Delimited string to convert to a document.

  • fieldQualifier: String Optional - The delimiter to use for separating entries in delimitedDataString. Default is comma (,).

  • textQualifier: String Optional - The character to use for quoted elements. Default is double quote (").

  • useHeaderRowForFieldNames: String Optional - Consider first line as header row and use the delimited data of this line as property names in the output document.

    Set to:

    • true - The delimited data of first line will be used as the property name in the output document. This is the default.

    • false - column1, column2...columnN will be used as the property name in the output document.

  • encoding: String Optional - The encoding to use while parsing the delimited data.

Output Parameters

  • document: Document - Document resulting from the conversion of delimitedDataString. This document contains document array rows[] corresponding to the delimited data.

documentToDelimitedDataBytes

Converts a document to delimited data bytes (byte array object).

Input Parameters

  • document: Document - Document to be converted to delimited data bytes (byte array object). This document contains document array rows[] corresponding to the delimited data.

  • fieldQualifier: String Optional - The delimiter to use for separating entries in delimitedDataBytes. Default is comma (,).

  • textQualifier: String Optional - The character to use for quoted elements. Default is double quote (").

  • useFieldNamesForHeaderRow: String Optional - The first line in the output delimited data delimitedDataBytes will be constructed using the property names in the input document array document\rows[].

    Set to:

    • true - Property names in the input document array document\rows[] will be used as the first row in the output delimitedDataBytes.

    • false - column1, column2...columnN will be used as the first row in the output delimitedDataBytes.

  • encoding: String Optional - The encoding to use while parsing the delimited data.

Output Parameters

  • delimitedDataBytes: Object - Delimited data byte array object resulting from the conversion of a document.

documentToDelimitedDataStream

Converts a document to a delimited data stream.

Input Parameters

  • document: Document - Document to be converted to delimited data stream. This document contains document array rows[] corresponding to the delimited data.

  • fieldQualifier: String Optional - The delimiter to use for separating entries in delimitedDataStream. Default is comma (,).

  • textQualifier: String Optional - The character to use for quoted elements. Default is double quote (").

  • useFieldNamesForHeaderRow: String Optional - The first line in the output delimited data delimitedDataStream will be constructed using the property names in the input document array document\rows[].

    Set to:

    • true - Property names in the input document array document\rows[] will be used as the first row in the output delimitedDataStream.

    • false - column1, column2...columnN will be used as the first row in the output delimitedDataStream.

  • encoding: String Optional - The encoding to use while parsing the delimited data.

Output Parameters

  • delimitedDataStream: java.io.InputStream - Delimited data stream resulting from the conversion of a document.

documentToDelimitedDataString

Converts a document to a delimited data string.

Input Parameters

  • document: Document - Document to be converted to delimited data string. This document contains document array rows[] corresponding to the delimited data.

  • fieldQualifier: String Optional - The delimiter to use for separating entries in delimitedDataString. Default is comma (,).

  • textQualifier: String Optional - The character to use for quoted elements. Default is double quote (").

  • useFieldNamesForHeaderRow: String Optional - The first line in the output delimited data delimitedDataString will be constructed using the property names in the input document array document\rows[].

    Set to:

    • true- Property names in the input document array document\rows[] will be used as the first row in the output delimitedDataString.

    • false - column1, column2...columnN will be used as the first row in the output delimitedDataString.

  • encoding: String Optional - The encoding to use while parsing the delimited data.

Output Parameters

  • delimitedDataString: String - Delimited data byte string resulting from the conversion of a document.

Flow Services

Use flow services to perform utility-type tasks.

The following flow services are available:

Service Description
clearPipeline Removes all fields from the pipeline. You may optionally specify fields that should not be cleared by this service.
countProcessedDocuments Counts the number of documents processed by a flow service. Details about the processed documents can be viewed in the Execution Results screen.
getHTTPRequest Gets information about the HTTP request, received by IBM webMethods Integration.
getLastError Obtains detailed information about the last error that was trapped within a flow service.
getLastFailureCaught Returns information about the last failure that was caught by a CATCH step.
getSessionInfo Obtains detailed information about the current logged-in user session. Also provides the current flow service name and the execution result reference identifier.
getRetryCount Retrieves the retry count and the maximum retry count for a service.
logCustomMessage Logs a message, which can be viewed in the Execution Results screen.
setCustomContextID Associates a custom value with an auditing context. You can use the custom value to search for flow service executions based on the custom ID in the IBM webMethods Integration Monitor screen.
setHTTPResponse Sets the HTTP response information to be returned by IBM webMethods Integration.
sleep Causes the currently executing flow service to pause for the specified number of seconds.
throwExceptionForRetry Throws an ISRuntimeException and instructs the to re-execute a service using the original service input.

clearPipeline

Removes all fields from the pipeline. You may optionally specify fields that should not be cleared by this service.

Input Parameters

  • preserve: String List Optional - Field names that should not be cleared from the pipeline.

Output Parameters

None.

countProcessedDocuments

Counts the number of documents processed by a flow service. Details about the processed documents can be viewed in the Execution Results screen.

Input Parameters

  • status: String Optional - Valid values are success or fail. Set status to success to count the number of successfully processed documents, else set it to fail. Default value is success.

  • incrementBy: String Optional - Increment the number of documents processed by a flow service. Every time the service is used, successful or failed documents are incremented by the given value. Default value is 1.

Output Parameters

None.

Usage Notes

To increment the number of documents processed by a list, use the sizeOfList service in the List service category.

getHTTPRequest

Retrieves information about the HTTP request, received by IBM webMethods Integration.

Input Parameters

None.

Output Parameters

  • httpRequest: Document - Contains the HTTP request received by IBM webMethods Integration and includes following details:

    • headers: Document - Contains the header fields from the HTTP request.

    • requestURL: String - URL used by the client to invoke the service.

    • method: String - HTTP method used by the client to request the top-level service. Possible values are GET, PUT, POST, PATCH, and DELETE.

Note: The getHTTPRequest service does not retrieve the Authorization header.

getLastError

Obtains detailed information about the last error that was trapped within a flow service.

Input Parameters

None.

Output Parameters

  • lastError: Document - Information about the last error, which contains details of the time, error, user, block, and call stack information.

    • time: String - Date and time the event occurred, in the format yyyy/MM/dd HH:mm:ss.SSS

    • error: String Optional - Error message of the exception.

    • localizedError: String Optional - Error message in the language that corresponds to the server locale.

    • user: String - User who executed the flow service.

    • block: Document - Contains the following fields:

      name: String - flow service, Operation, or Service name.

      type: String - Connector, flow service, or Service.

      details: String Optional - Account and Application name if the Block Type is Application.

    • callStack: Document List - The call stack information describing where the error occurred including details of the block. Each document represents a block on the call stack. The first document in the list represents the block that threw the error and the last document in the list represents the top level block. It contains the following fields:

      name: String - flow service, Operation or Service

      name.type: String - Connector, flow service, or Service.

    • errorDetails: Document Optional - Additional exception information.

Usage Notes

You can use this service in the catch section of the try-catch block. Each execution of a flow service or a service (whether the flow service or the service succeeds or fails) updates the value returned by getLastError. Consequently, getLastError itself resets the value of lastError. Therefore, if the results of getLastError will be used as input to subsequent flow services, map the value of lastError to a variable in the pipeline.

If a map has multiple transformers, then a subsequent call to getLastError will return the error associated with the last failed transformer in the map, even if it is followed by successful transformers.

getLastFailureCaught

Returns information about the last failure that was caught by a CATCH step.

Input Parameters

None.

Output Parameters

  • failure: Object - Last failure caught by a CATCH step. The failure parameter is null if no failure has been caught.

  • failureMessage: String, Conditional - Message associated with the failure. The service returns a failureMessage output parameter only if a failure has been caught.

  • failureName: String, Conditional - Exception class name. The service returns a failureName output parameter only if a failure has been caught.

Usage Notes

If a CATCH step can handle multiple failures, use the getLastFailureCaught service to determine which failure the step caught.

You can rethrow a caught failure by using the getLastFailureCaught service to determine the failure caught by the CATCH step, then use an EXIT step that is configured to signal failure to rethrow the failure. getLastFailureCaught need not be executed within a CATCH step. The service returns the caught failure any time after it has been started.

getSessionInfo

Obtains detailed information about the current logged-in user session. Also provides the current flow service execution result reference identifier.

Input Parameters

None.

Output Parameters

  • $session: Document - Returns information about the current logged-in user session. Also provides the current flow service name and the execution result reference identifier.

    • tenantId: String - Tenant Identifier.

    • stageId: String - The stage ID where the current flow service resides.

    • user: Document - Returns user details.

      name: String - Name of the user who is executing the service.

​ ​ - CustomContextID: String - Returns the current flow service execution context ID. You can set the context ID in a flow service by using the setCustomContextID service available under the Flow category. ​ ​ - integrationName: String - The name of the flow service. If flow service A has a referenced flow service B, and if the getSessionInfo service is called in flow service B, then integrationName will be A but if flow service B is executed independently, then integrationName will be B. ​ ​ - executionResultReference: String - Returns the current flow service execution result reference identifier. For example, you can pass the identifier to an on-premises operation and trace the flow service execution.

getRetryCount

Retrieves the retry count and the maximum retry count for a flow service.

The retry count indicates the number of times the IBM webMethods Integration system has re-executed a flow service. For example, a retry count of 1 indicates that the IBM webMethods Integration system tried to execute the flow service twice (the initial attempt and then one retry).

The maximum retry count indicates the maximum number of times the IBM webMethods Integration system can re-execute the flow service if it continues to fail because of a transient error.

Input Parameters

None.

Output Parameters

  • retryCount: String - The number of times the IBM webMethods Integration system has re-executed the flow service.

  • maxRetryCount: String The maximum number of times the IBM webMethods Integration system can re-execute the flow service.

Usage Notes

Although the getRetryCount service can be started at any point in a flow service, the getRetryCount service retrieves retry information for the flow service when started by a subscriber. The getRetryCount service does not retrieve retry information for a nested flow service (a flow service that is started by another flow service).

The maximum number of times IBM webMethods Integration retries a flow service depends on the retry properties set in the subscriber that invokes the flow service.

logCustomMessage

Logs a message, which can be viewed in the Execution Results screen.

Input Parameters

  • message: String - Custom message to be logged, which can be viewed in the Execution Results screen.

Output Parameters

None.

Note: Starting from IBM webMethods Integration 11.0.10 release, new tenants are subject to the maximum size limit of 1 MB for custom log messages.

setCustomContextID

Associates a custom value with an auditing context. This custom value can be used to search for flow service executions in the Monitor screen.

Input Parameters

  • id: String Optional - The custom value for the current auditing context. Specify a value that you want to associate with the auditing context. The ID length must be less than or equal to 36 characters. In the event that an ID exceeds 36 characters, only the first 36 characters are stored.

Output Parameters

None.

Usage Notes

  • Each client request creates a new auditing context. The auditing context is the lifetime of the top-level service. Once the custom context identifier is set, IBM webMethods Integration includes that value in each service audit record it logs in the current context. Calls to this service affect audit logging only for the current request.
  • This service is useful when IBM webMethods Integration is configured to log to a database. When the server logs information about a service to the database, it includes the custom context identifier in the service log. On the IBM webMethods Integration Monitor screen, you can use the custom value as search criteria to locate and view all corresponding service audit records.
  • If IBM webMethods Integration is configured to log to a file system, IBM webMethods Integration writes the custom context identifier with the service audit records to a file. This file is not accessible on the Monitor screen. You cannot query service records when logging to a file.
  • If this service is started without a specified value for id, IBM webMethods Integration writes a null value for the custom context identifier field for all subsequent service audit records that it logs in the current context.

setHTTPResponse

Sets the HTTP response information to be returned by IBM webMethods Integration.

Input Parameters

  • httpResponse: Document - Contains the HTTP response that will be returned by IBM webMethods Integration and includes following details:

    • headers: Document Optional - Contains the header fields to be returned in the HTTP response.
    • responseCode: String Optional - HTTP status code to be returned to the client. The response codes and phrases are defined in https://tools.ietf.org/html/rfc7231#section-6. If you provide a value for responseCode that is not listed in RFC 7321, Section 6, you must also provide a value for reasonPhrase.
    • responsePhrase: String Optional - HTTP reason phrase to be returned to the client. If no reason is provided, the default reason phrase associated with responseCode will be used. You must provide a reasonPhrase for any responseCode that is not listed in RFC 7321, Section 6.
    • responseString: String Optional - Response to be returned to the client, specified as a string.
    • responseBytes: byte[] Optional - Response to be returned to the client, specified as a byte array.
    • responseStream: java.io.InputStream Optional - Response to be returned to the client, specified as an InputStream.

Output Parameters

None.

Note: When working with a flow service, always set the responseString parameter in the setHTTPResponse service as the last step. This is so because the flow service does not run in debug mode as the setHTTPResponse service stops it when the responseString parameter is set. However, the setHTTPResponse service can be used at any step in a flow service if responseString is not being set.

sleep

Causes the currently executing flow service to pause for the specified number of seconds.

Input Parameters

  • seconds: String - The number of seconds to pause the currently executing flow service. The value must be an integer between 1 second and 60 seconds.

Output Parameters

None.

throwExceptionForRetry

Throws an exception and instructs IBM webMethods Integration to re-execute the flow service using the original service input.

Input Parameters

  • wrappedException: Object Optional - Any exception that you want to include as part of this exception. This might be the exception that causes the throwExceptionForRetry service to execute. For example, if a Salesforce connector fails to connect to the server due to connection timeout you can use this service inside Catch block to retry the flow service again.

  • message: String Optional - A message to be logged as part of this exception.

Output Parameters

None.

Usage Notes

Use the throwExceptionForRetry service to handle transient errors that might occur during flow service execution. A transient error is an error that arises from a condition that might be resolved quickly, such as the unavailability of a resource due to network issues or failure to connect to a database. The flow service might execute successfully if IBM webMethods Integration waits and then retries the flow service. If a transient error occurs, the flow service can catch this error and invoke throwExceptionForRetry to instruct the to retry the service.

The throwExceptionForRetry service must be used for transient errors only.

Only top-level services or subscribers can be retried. That is, a service can be retried only when it is started directly by a client request or by a subscriber. The service cannot be retried when it is started by another flow service (that is, when it is a nested flow service).

You can invoke the getRetryCount service to retrieve the current retry count and the maximum specified retry attempts.

Hashtable Services

Use Hashtable services to create, update, and obtain information about the hashtable.

The following Hashtable services are available:

Service Description
containsKey Checks for the existence of a hashtable element.
createHashtable Creates a hashtable object.
get Gets the value for a specified key in the hashtable.
listKeys Lists all the keys stored in the hashtable.
put Adds a key/value pair in the hashtable.
remove Removes a key/value pair from the hashtable.
size Gets the number of elements in the hashtable.

containsKey

Checks for the existence of a hashtable element.

Input Parameters

  • hashtable: java.util.Hashtable - Hashtable in which to check for the existence of a hashtable element.
  • key: String - Hashtable element to be checked for.

Output Parameters

  • containsKey: String - Indicates whether the specified hashtable element exists.

    A value of:

    • true - Indicates that the element exists.

    • false - Indicates that the element does not exist.

createHashtable

Creates a hashtable object.

Input Parameters

None.

Output Parameters

  • hashtable: java.util.Hashtable - The new hashtable object.

get

Gets the value for a specified key in the hashtable.

Input Parameters

  • hashtable: java.util.Hashtable - Hashtable from which to retrieve the specified value.

  • key: String - Key of the hashtable element whose value is to be retrieved.

Output Parameters

  • value: Object - Value of the input hashtable element.

listKeys

Lists all the keys stored in the hashtable.

Input Parameters

  • hashtable: java.util.Hashtable - Hashtable from which the keys are to be listed.

Output Parameters

  • keys: String[] - List of keys stored in the input hashtable.

put

Adds a key/value pair in the hashtable.

Input Parameters

  • hashtable: java.util.Hashtable - Hashtable to which the key/value pair is to be added.

  • key: String - Key of the element to be added to the hashtable.

  • value: Object - Value of the element to be inserted into the hashtable.

Output Parameters

  • hashtable: java.util.Hashtable - Hashtable object after the insertion of the key/value pair.

remove

Removes a key/value pair from the hashtable.

Input Parameters

  • hashtable: java.util.Hashtable - Hashtable from which to remove the key/value pair.

  • key: String - Key of the hashtable element to be removed.

Output Parameters

  • hashtable: java.util.Hashtable - Hashtable object after the key/value pair is removed.

  • value: Object - Value of the hashtable element that was removed. Returns null if the input key is not found in the hashtable.

size

Gets the number of elements in the hashtable.

Input Parameters

  • hashtable: java.util.Hashtable - Hashtable from which the number of elements stored in it is to be retrieved.

Output Parameters

  • size: String - Number of elements in the hashtable.

IO Services

Use IO services to convert data between byte[ ], characters, and InputStream representations. These services are used for reading and writing bytes, characters, and streamed data to the file system and behave like the corresponding methods in the java.io.InputStream class. These services can be started only by other services. Streams cannot be passed between clients and the server, so these services will not run if they are started from a client.

The following IO services are available:

Service Description
bytesToStream Converts a byte[ ] to java.io.ByteArrayInputStream.
close Closes an InputStream or a reader object and releases the resources.
createByteArray Creates a byte array of the specified length.
mark Marks the current position in the InputStream or reader object.
markSupported Enables you to test whether your InputStream or reader object supports the mark and reset operations.
read Reads a specified number of bytes from the InputStream and stores them into a buffer.
readAsString Reads the data from a reader object and converts it to a string.
reset Repositions the InputStream or the reader object to the position at the time the mark service was last started on the stream.
skip Skips over and discards the specified number of bytes or characters from the input stream or a reader object.
streamToBytes Creates a byte[ ] from data that is read from an InputStream.
streamToReader Converts a java.io.InputStream to a java.io.Reader object.
streamToString Creates a string from data that is read from an InputStream.
stringToReader Converts a string object to a String Reader object.
stringToStream Converts a string to a binary stream.

bytesToStream

Converts a byte[ ] to java.io.ByteArrayInputStream.

Input Parameters

  • bytes: byte[ ] - The byte array to convert.
  • length: String Optional - The maximum number of bytes to read and convert. If length is not specified, the default value for this parameter is the length of the input byte array.
  • offset: String Optional - The offset into the input byte array from which to start converting. If no value specified, the default value is zero.

Output Parameters

  • stream: java.io.ByteArrayInputStream - An open InputStream created from the contents of the input bytes parameter.

Usage Notes

This service constructs stream from the byte array using the constructor ByteArrayInputStream(byte[ ]). This constructor does not make a copy of the byte array, so any changes to bytes will be reflected in the data read from the stream.

close

Closes an InputStream or a reader object and releases the resources.

Input Parameters

  • inputStream: java.io.InputStream. Optional - An open InputStream.
Note: You can use either inputStream or reader to specify the input object. If both the input parameters are provided, then both the objects will be closed.
  • reader: java.io.Reader.Optional - An open reader object.

Output Parameters

None.

Usage Notes

If the InputStream is already closed, invoking this service has no effect. However, leaving an InputStream open may cause errors that may not be recoverable. Use the close service to explicitly close the input stream when a service leaves it open.

createByteArray

Creates a byte array of the specified length.

Input Parameters

  • length: String. The length of the byte array to be created.

Output Parameters

  • bytes: Object The new byte array.

Usage Notes

The read service reads data from an InputStream into a byte array. You can use this service to create the byte array. Invoking this service is the equivalent of the Java code new byte[length].

mark

Marks the current position in the InputStream or reader object. A subsequent call to reset repositions this stream at the last marked position. Marking and respositioning the input stream allows subsequent service calls to re-read the same bytes.

Input Parameters

  • stream: java.io.InputStream. Optional - The InputStream.
Note: You can use either stream or reader to specify the input object. If both stream and reader input parameters are provided, then both the objects will be marked.
  • reader: java.io.Reader. Optional - The reader object.

  • limit: String - The maximum number of bytes that can be read before the mark position becomes invalid. If more than this number of bytes are read from the stream after the mark service is started, the reset service will have no effect.

Output Parameters

  • stream: java.io.InputStream. Conditional - The InputStream. Returned only if the input parameter is stream.

  • reader: java.io.Reader. Conditional - The reader object. Returned only if the input parameter is reader.

Usage Notes

If the InputStream does not support the mark operation, invoking this service has no effect.

Either of the optional input parameters, stream or reader, is required.

markSupported

Enables you to test whether your InputStream or reader object supports the mark and reset operations.

Input Parameters

  • stream: java.io.InputStream. Optional - The InputStream.
Note: You can use either stream or reader to specify the input object. If both stream and reader input parameters are provided, then the stream input parameter is ignored.
  • reader: java.io.Reader. Optional - The reader object.

Output Parameters

  • stream: java.io.InputStream. Conditional - The InputStream. Returned only if the input parameter is stream.

  • supported: String - Indicates whether the stream supports the mark and reset operations. A value of:

    • true indicates that the InputStream supports the mark and reset operations.

    • false indicates that the InputStream does not support the mark and reset operations.

  • reader: java.io.Reader. Conditional - The reader object. Returned only if the input parameter is reader.

Usage Notes

Either of the input parameters, stream or reader, is required.

read

Reads a specified number of bytes from the InputStream and stores them into a buffer.

Input Parameters

  • stream: Object - The InputStream. Object from which the service is to read bytes.

  • offset: String. Optional - The offset into the byte array in the buffer to which the data is written. If no value is supplied, this defaults to 0.

  • length: String. Optional - The maximum number of bytes to read from the InputStream. If no value is supplied, the default is the length of buffer. If the value supplied for length is greater than the length of buffer, an exception will be thrown.

  • buffer: Object - The buffer into which data is written. This is a byte array, which can be created from a flow service by invoking createByteArray.

Output Parameters

  • stream: Object - The InputStream. If any bytes were read from the stream, the stream is repositioned after the last byte read.

  • buffer: Object - The buffer into which data was written.

  • bytesRead: String - The number of bytes read from the InputStream and copied to buffer. If there is no more data because the end of the stream has been reached, bytesRead will be -1.

readAsString

Reads the data from a reader object and returns the contents as a string.

Input Parameters

  • reader: java.io.Reader - The reader object.

  • length: String - The maximum number of characters to read from the input reader object.

Output Parameters

  • reader: java.io.Reader - The reader object.

  • lengthRead: String - The number of characters read from the input reader object. If there is no more data because the end of the stream has been reached, lengthRead will be -1.

  • value: String - The data read from the reader object, or null if end of stream has been reached.

Usage Notes

The readAsString service does not automatically close the reader object. To close the reader, use the close service.

readerToString

Reads the data from a reader object and converts it to a string.

Input Parameters

  • reader: java.io.Reader - The reader object.

Output Parameters

  • string: String - Data read from the reader object.

Usage Notes

The readerToString service does not automatically close the reader object. To close the reader, use the close service.

reset

Repositions the InputStream or the reader object to the position at the time the mark service was last started on the stream.

Input Parameters

  • stream: java.io.InputStream. Optional - The InputStream.

Note: You use either stream or reader to specify the input object. If both stream and reader input parameters are provided, then both the objects will be reset.
  • reader: java.io.Reader. Optional - The reader object.

Output Parameters

  • stream: java.io.InputStream. Conditional - The InputStream. Returned only if the input parameter is stream.

  • reader: java.io.Reader. Conditional - The reader object. Returned only if the input parameter is reader.

Usage Notes

If the InputStream does not support the reset operation, invoking this service has no effect.

Either of the input parameters, stream or reader, is required.

skip

Skips over and discards the specified number of bytes or characters from the input stream or a reader object.

Input Parameters

  • stream: java.io.InputStream. Optional - The InputStream.
Note: You can use either stream or reader to specify the input object. If both stream and reader input parameters are provided, then the stream and reader object data will be skipped.
  • reader: java.io.Reader. Optional - The reader object.

  • length: String - The number of bytes or characters to skip.

Output Parameters

  • stream: java.io.InputStream. Conditional - The InputStream. Returned only if the input parameter is stream.

  • reader: java.io.Reader. Conditional - The reader object. Returned only if the input parameter is reader.

  • bytesSkipped: String. Conditional - The actual number of bytes that were skipped. Returned only if the input parameter is stream.

  • charactersSkipped: String. Conditional - The number of characters that were skipped. Returned only if the input parameter is reader.

Usage Notes

The Skip service uses the Java methodskip, which might skip some smaller number of bytes, possibly zero (0). This happens due to conditions such as reaching the end of file before n bytes have been skipped. For more information about the skip method, see the Java documentation on the InputStream class.

Either of the optional input parameters, stream or reader, is required.

If both stream and reader input parameters are specified and if an exception occurs during the stream object usage, then the operations are not performed on the reader object also.

streamToBytes

Creates a byte[ ] from data that is read from an InputStream.

Input Parameters

  • stream: java.io.InputStream - The InputStream that you want to convert.

Output Parameters

  • bytes: byte[ ] - The bytes read from stream.

Usage Notes

This service reads all of the bytes from stream until the end of file is reached, and then it closes the InputStream.

streamToReader

Converts a java.io.InputStream to a java.io.Reader object.

Input Parameters

  • inputStream: java.io.InputStream - The InputStream to convert to a reader object.

  • encoding: String. Optional - Name of a registered, IANA character set (for example, ISO-8859-1). If you specify an unsupported encoding, the system throws an exception. If no value is specified or if the encoding is set to autoDetect, the default operating system encoding is used.

Output Parameters

  • reader: java.io.Reader - The reader object read from inputStream.

streamToString

Creates a string from data that is read from an InputStream.

Input Parameters

  • inputStream: java.io.InputStream - The InputStream to convert to a string.

  • encoding: String Optional - Name of a registered, IANA character set (for example, ISO-8859-1). If you specify an unsupported encoding, the system throws an exception. If no value is specified the encoding will be UTF-8.

Output Parameters

  • string: String - Data read from inputStream and converted to a string.

stringToReader

Converts a string object to a StringReader object.

Input Parameters

  • string: String - The string to convert to a StringReader object.

Output Parameters

  • reader: java.io.StringReader - The StringReader object.

stringToStream

Converts a string to a binary stream.

Input Parameters

  • string: String - The string object to be converted.

  • encoding: String - Optional. Name of a registered, IANA character set, for example, ISO-8859-1. If you specify an unsupported encoding, the system throws an exception. If no value is specified, the encoding will be UTF-8.

Output Parameters

  • inputStream: java.io.ByteArrayInputStream - An open InputStream created from the contents of string.

JSON Services

Use JSON services to convert JSON content into a document and to convert a document into JSON content.

The following JSON services are available:

Service Description
closeArrayIterator Closes the iteration. The iterator object used in an iteration cannot be reused after this service runs.
documentToJSONBytes Converts a document to JSON bytes (byte array).
documentToJSONStream Converts a document to a JSON stream.
documentToJSONString Converts a document to a JSON string.
getArrayIterator Returns a batch iterator object.
getNextBatch Gets the next batch of array elements by parsing the array paths in the iterator object returned by the getArrayIterator service.
jsonBytesToDocument Converts JSON content in bytes (byte array) to a document.
jsonStreamToDocument Converts content from the JSON content stream to a document.
jsonStringToDocument Converts content from the JSON string to a document.

closeArrayIterator

Closes the iteration. The iterator object used in an iteration cannot be reused after this service runs.

Input Parameters

  • iterator: Object - The iterator object returned by the getNextBatch service.

Output Parameters

None.

documentToJSONBytes

Converts a document to JSON bytes (byte array).

Input Parameters

  • document: Document - The document to be converted to JSON bytes (byte array).

  • encodeDateAs: String. Optional. Specifies how java.util.Date instances in the document are encoded in the returned JSON.

    • long to encode java.util.Date instances as timestamps, specifically the number of milliseconds since Jan 1, 1970 00:00:00.

    • ISO8601 to encode java.util.Date instances as strings in a standard ISO format of: YYYY-MM-DD'T'HH:mm:ss.sssZ.

    • ISO_LOCAL_DATE to encode java.util.Date instances as strings in a standard ISO format without an offset.

    • ISO_DATE to encode java.util.Date instances as strings in a standard ISO format with the offset if available.

    • ISO_ZONED_DATE_TIME to encode java.util.Date instances as strings in a standard ISO format with the offset and zone if available.

    • ISO_INSTANT to encode java.util.Date instances as strings in a standard ISO format in UTC.

    • BASIC_ISO_DATE to encode java.util.Date instances as strings in a standard ISO format without an offset.

    • RFC_1123_DATE_TIME to encode java.util.Date instances as strings in a standard ISO format.

    • null to use the dateEncoding setting already in effect for the HTTP client making the request.

  • encodeStringAsNumber: String. Optional.

    • true, to convert all the numbers in the string format to numbers by removing the quotes.

    • false, to retain all the numbers without converting.

    The default value is false.

  • encodeStringAsBoolean: String. Optional.

    • true, to convert all the boolean values in the string format to Boolean by removing the quotes.

    • false, to retain all the boolean values without converting. The default value is false.

Output Parameters

  • jsonBytes: Object - JSON bytes (byte array) resulting from the conversion of a document.

documentToJSONStream

Converts a document to a JSON stream.

Input Parameters

  • document: Document - The document to be converted to a JSON stream.

  • encodeDateAs: String. Optional. Specifies how java.util.Date instances in the document are encoded in the returned JSON.

    • long to encode java.util.Date instances as timestamps, specifically the number of milliseconds since Jan 1, 1970 00:00:00.

    • ISO8601 to encode java.util.Date instances as strings in a standard ISO format of: YYYY-MM-DD'T'HH:mm:ss.sssZ.

    • ISO_LOCAL_DATE to encode java.util.Date instances as strings in a standard ISO format without an offset.

    • ISO_DATE to encode java.util.Date instances as strings in a standard ISO format with the offset if available.

    • ISO_ZONED_DATE_TIME to encode java.util.Date instances as strings in a standard ISO format with the offset and zone if available.

    • ISO_INSTANT to encode java.util.Date instances as strings in a standard ISO format in UTC.

    • BASIC_ISO_DATE to encode java.util.Date instances as strings in a standard ISO format without an offset.

    • RFC_1123_DATE_TIME to encode java.util.Date instances as strings in a standard ISO format.

    • null to use the dateEncoding setting already in effect for the HTTP client making the request.

  • encodeStringAsNumber: String. Optional.

    • true, to convert all the numbers in the string format to numbers by removing the quotes.

    • false, to retain all the numbers without converting.

    The default value is false.

  • encodeStringAsBoolean: String. Optional.

    • true, to convert all the boolean values in the string format to Boolean by removing the quotes.

    • false, to retain all the boolean values without converting. The default value is false.

Output Parameters

  • jsonStream: java.io.InputStream - JSON stream resulting from the conversion of a document.

documentToJSONString

Converts a document to a JSON string.

Input Parameters

  • document: Document - The document to be converted to a JSON string.

  • prettyPrint: String - Formats the jsonString output parameter for human readability by adding carriage returns and indentation to the JSON content.

    Set to:

    • true to format the jsonString output field for human readability.

    • false to leave the jsonString output field in its unformed state.

    The service will not add any additional carriage returns or indentation to the JSON content.

  • encodeDateAs: String. Optional. Specifies how java.util.Date instances in the document are encoded in the returned JSON.

    • long to encode java.util.Date instances as timestamps, specifically the number of milliseconds since Jan 1, 1970 00:00:00.

    • ISO8601 to encode java.util.Date instances as strings in a standard ISO format of: YYYY-MM-DD'T'HH:mm:ss.sssZ.

    • ISO_LOCAL_DATE to encode java.util.Date instances as strings in a standard ISO format without an offset.

    • ISO_DATE to encode java.util.Date instances as strings in a standard ISO format with the offset if available.

    • ISO_ZONED_DATE_TIME to encode java.util.Date instances as strings in a standard ISO format with the offset and zone if available.

    • ISO_INSTANT to encode java.util.Date instances as strings in a standard ISO format in UTC.

    • BASIC_ISO_DATE to encode java.util.Date instances as strings in a standard ISO format without an offset.

    • RFC_1123_DATE_TIME to encode java.util.Date instances as strings in a standard ISO format.

    • null to use the dateEncoding setting already in effect for the HTTP client making the request.

  • encodeStringAsNumber: String. Optional.

    • true, to convert all the numbers in the string format to numbers by removing the quotes.

    • false, to retain all the numbers without converting.

    The default value is false.

  • encodeStringAsBoolean: String. Optional.

    • true, to convert all the boolean values in the string format to Boolean by removing the quotes.

    • false, to retain all the boolean values without converting.

      The default value is false.

Output Parameters

  • jsonString: Object - JSON string resulting from the conversion of a document.

getArrayIterator

Returns a batch iterator object.

Input Parameters

  • jsonStream: Object - JSON content to be converted to a document (an IData object).

  • arrayPaths: String List - The paths of the arrays to be parsed in the JSON input stream. Only the array elements from the paths mentioned in this parameter are considered even though the JSON stream might have more data. For example, to retrieve toppingA1 from the following JSON content, provide the array path as, /topping/0/toppingA/0/toppingA1.




                    "topping": [{
                    "toppingA": [{
                    "toppingA1": ["None71", "Glazed82"]
                    ...
                    }]}]

                
Note: This parameter must have only array paths. You must not enter individual array elements or other fields. Array paths must follow the JSON pointer syntax.
  • containsKey: String - Indicates whether the specified hashtable element exists. A value of:

    • true - Indicates that the element exists.

    • false - Indicates that the element does not exist.

  • decodeRealAsDouble: String. Optional - Converts real numbers from jsonStream to either a Float or Double Java wrapper type. Set to:

    • true to convert real numbers to Double Java wrapper type. This is the default.

    • false to convert real numbers to Float Java wrapper type.

Note: The decodeRealAsDouble parameter overrides the value specified by the decodeRealAsDouble server configuration parameter. If no value is supplied for decodeRealAsDouble, IBM webMethods Integration uses the value set for decodeRealAsDouble server configuration parameter.
  • decodeIntegerAsLong: String. Optional - Converts integers from jsonStream to either a Long or Integer Java wrapper type. Set to:

    • true to convert integers to Long Java wrapper types. This is the default.

    • false to convert integers to Integer Java wrapper types.

Note: The decodeIntegerAsLong parameter overrides the value specified by the decodeIntegerAsLong server configuration parameter. If no value is supplied for decodeIntegerAsLong, IBM webMethods Integration uses the value specified in the decodeIntegerAsLong server configuration parameter.
  • decodeRealAsString: String. Optional - Converts real numbers in the jsonStream to String. Set to:

    • true to convert real numbers to String.

    • false to not convert real numbers to String. The real numbers are then converted to either Float or Double Java wrapper type depending on the value specified in decodeRealAsDouble. This is the default value.

Note: The decodeRealAsString parameter overrides the value specified by the decodeRealAsString server configuration parameter. If no value is supplied for decodeRealAsString, IBM webMethods Integration uses the value set in decodeRealAsString server configuration parameter.
  • unescapeSpecialChars: String. Optional - Controls whether IBM webMethods Integration unescapes the special characters '\n', '\r', '\t', '\b', '\f', '\\', '\"' while parsing JSON documents. Set to:

    • true to unescape these special characters (that is, '\n' will be replaced with new line, similarly other characters will also be replaced) in the output document. This is the default.

    • false to keep these characters as is in the output document.

Note: The unescapeSpecialChars parameter overrides the value specified by the unescapeSpecialChars server configuration parameter. If no value is supplied for unescapeSpecialChars, IBM webMethods Integration uses the value specified in the unescapeSpecialChars server configuration parameter.

Output Parameters

  • iterator: Object - A batch iterator object that has the list of arrays to be parsed in the JSON input stream. This object is passed as input to the getNextBatch service.

Usage Notes

None.

getNextBatch

Gets the next batch of array elements by parsing the array paths in the iterator object returned by the getArrayIterator service. This service returns the array elements in batches based on the batch size provided in the input. The batch size can vary across invocations of this service. A batch is a set of elements that can be retrieved from an array path at once, based on the batch size. To retrieve the remaining elements in the array path or elements from the next array path in the iterator, invoke the service in a loop until there are no more array paths to iterate.

Input Parameters

  • iterator: Object - The iterator object returned by the getArrayIterator service.

  • batchSize: Object - Number of array elements that the service should retrieve in one batch.

Note: This value must be lesser or equal to the value of the iterator.maxBatchSize server configuration property. Similarly, it must be greater or equal to the value of the iterator.minBatchSize server configuration property. Otherwise, the service throws an error.

Output Parameters

  • batch: Document - IData object that contains the following keys.

    • arrayPath: String - The path of the array elements retrieved in a batch. Since the service can iterate over multiple arrays, each batch contains the array path parsed in current iteration to help you identify the array to which the elements in the batch belong.

    • documents []: Document List - If array elements in the batch are JSON objects, they are returned as documents.

    • values []: Object List - If array elements in the batch are not JSON objects, they are returned as values.

  • iterationStatus: Document - IData object that contains the following keys.

    • hasNext: String - Indicates whether there are more array elements in the iterator beyond this batch, which the service can retrieve. The value can be true or false.

    • iteration: String - Indicates the current iteration. It starts from 1. If the service runs N times to get all the array elements, then this value is N.

    • numberOfElementsInBatch: String - Indicates the number of elements in the current batch. This value is same as batchSize. However, this value can be less than the batch size for the last batch. For example, if there are 7 elements in an array and the batch size is 5, then the last batch will have only 2 elements.

    • totalElementsParsed: String - Indicates the number of array elements parsed until the current iteration. For example, if the number of elements parsed in the first iteration is 10, second iteration is 20, and third iteration is 7, then in the third iteration, the value of this parameter is 37.

Usage Notes

The getNextBatch service completes the retrieval of elements from one array in the iterator and starts retrieving from the next array that matches in the subsequent iteration. This is explained in the following example:

Suppose you want the service to parse a JSON file with 2 arrays, for example, A and B with 6 and 2 elements each. Set the batchSize input parameter to 5 and invoke the service in a loop until the service returns the hasNext parameter as false. In the first batch of the output, the first 5 elements of the array A are returned and in the next batch, only the last element of the array A is returned, even though the batch size is 5. At this point, the hasNext parameter is true because array B is not parsed yet. In the next batch, the service returns both the elements of array B. Since there are no more elements left either in the array A or B, the hasNext parameter becomes false .

Guidelines

  • If two array paths overlap, the path that the service finds first in the input JSON stream is parsed and the other path is ignored. If you provide arrayPath[0] as /a/b and arrayPath[1] as /a/b/0/c to parse the following array, arrayPath[1] is ignored as the paths overlap and the first path retrieves all elements.

    {
                                "a": {
                                "b": [{
                                "f1": "v1",
                                "c": [1, 2, 3]
                                }]
                                }
                                }
  • If an invalid array path is provided in the input, the getNextBatch service does not return any result on parsing the array.

  • If the arrayPaths input parameter is not set, then the getNextBatch service parses the input considering that the input stream has a single anonymous array at the root level.

  • If the arrayPaths input parameter is set, then it cannot contain null or empty elements.

  • If one or more array paths are invalid, then the getArrayIterator service still creates an iterator object containing these paths. However, the getNextBatch service ignores the invalid paths.

    If all the paths are invalid, the getNextBatch service returns the documents and values parameters as null, the hasNext parameter as false, and all other output parameters as 0.

jsonBytesToDocument

Converts JSON content in bytes (byte array) to a document.

Input Parameters

  • jsonBytes: java.lang.Byte[] - JSON content in bytes (byte array) to convert to a document.

  • decodeRealAsDouble - String Optional - Converts real numbers from jsonBytes to either a Float or Double Java wrapper type.

    Set to:

    • true to convert real numbers to Double Java wrapper types.

    • false to convert real numbers to Float Java wrapper types.

    Default value is true.

  • decodeIntegerAsLong: String Optional - Converts integers from jsonBytes to either a Long or Integer Java wrapper type.

    Set to:

    • true to convert integers to Long Java wrapper types.

    • false to convert integers to Integer Java wrapper types.

    Default value is true.

  • decodeRealAsString: String. Optional. Converts real numbers in the jsonStream to String. Set to:

    • true to convert real numbers to String.

    • false to not convert real numbers to String. The real numbers are then converted to either Float or Double Java wrapper type depending on the values specified in decodeRealAsDouble.

    Default value is false.

  • decodeNullRootAsEmpty: String. Optional. Converts a null value that IBM webMethods Integration retrieves from JSON content to either IData or empty IData. Set to:

    • true to convert the null value to empty IData. The subsequent encoding of empty IData creates a JSON text of “{}”. This JSON content is different from the original JSON content (null) as the original null value gets converted to JSON text of "{}".

    • false to convert the null value to IData.

    Default value is false.

  • unescapeSpecialChars: String. Optional. Controls whether IBM webMethods Integration unescapes the special characters '\n', '\r', '\t', '\b', '\f', '\', '"' while parsing JSON documents. Set to:

    • true to unescape these special characters (that is, '\n' will be replaced with new line, similarly other characters will also be replaced) in the output document.

    • false to keep these characters as is in the output document.

    Default value is true.

Output Parameters

  • document: Document - Document resulting from the conversion of jsonBytes.

jsonStreamToDocument

Converts content from the JSON content stream to a document. The permissible size of the content stream is based on your tenancy.

Input Parameters

  • jsonStream: java.io.InputStream - JSON content in an input stream to convert to a document.

  • decodeRealAsDouble - String Optional - Converts real numbers from jsonStream to either a Float or Double Java wrapper type.

    Set to:

    • true to convert real numbers to Double Java wrapper types.

    • false to convert real numbers to Float Java wrapper types.

    Default value is true.

  • decodeIntegerAsLong: String Optional - Converts integers from jsonStream to either a Long or Integer Java wrapper type.

    Set to:

    • true to convert integers to Long Java wrapper types.

    • false to convert integers to Integer Java wrapper types.

    Default value is true.

  • decodeRealAsString: String. Optional. Converts real numbers in the jsonStream to String. Set to:

    • true to convert real numbers to String.

    • false to not convert real numbers to String. The real numbers are then converted to either Float or Double Java wrapper type depending on the values specified in decodeRealAsDouble.

    Default value is false.

  • decodeNullRootAsEmpty: String. Optional. Converts a null value that IBM webMethods Integration retrieves from JSON content to either IData or empty IData. Set to:

    • true to convert the null value to empty IData. The subsequent encoding of empty IData creates a JSON text of “{}”. This JSON content is different from the original JSON content (null) as the original null value gets converted to JSON text of "{}".

    • false to convert the null value to IData.

    Default value is false.

  • unescapeSpecialChars: String. Optional. Controls whether IBM webMethods Integration unescapes the special characters '\n', '\r', '\t', '\b', '\f', '\', '"' while parsing JSON documents. Set to:

    • true to unescape these special characters (that is, '\n' will be replaced with new line, similarly other characters will also be replaced) in the output document.

    • false to keep these characters as is in the output document.

    Default value is true.

Output Parameters

  • document: Document - Document resulting from the conversion of jsonStream.

jsonStringToDocument

Converts content from the JSON content string to a document.

Input Parameters

  • jsonString: String - JSON content string to convert to a document.

  • decodeRealAsDouble - String Optional - Converts real numbers from jsonString to either a Float or Double Java wrapper type.

    Set to:

    • true to convert real numbers to Double Java wrapper types.

    • false to convert real numbers to Float Java wrapper types.

    Default value is true.

  • decodeIntegerAsLong: String Optional - Converts integers from jsonString to either a Long or Integer Java wrapper type.

    Set to:

    • true to convert integers to Long Java wrapper types.

    • false to convert integers to Integer Java wrapper types.

    Default value is true.

  • decodeRealAsString: String. Optional. Converts real numbers in the jsonStream to String. Set to:

    • true to convert real numbers to String.

    • false to not convert real numbers to String. The real numbers are then converted to either Float or Double Java wrapper type depending on the values specified in decodeRealAsDouble.

    Default value is false.

  • decodeNullRootAsEmpty: String. Optional. Converts a null value that IBM webMethods Integration retrieves from JSON content to either IData or empty IData. Set to:

    • true to convert the null value to empty IData. The subsequent encoding of empty IData creates a JSON text of “{}”. This JSON content is different from the original JSON content (null) as the original null value gets converted to JSON text of "{}".

    • false to convert the null value to IData.

    Default value is false.

  • unescapeSpecialChars: String. Optional. Controls whether IBM webMethods Integration unescapes the special characters '\n', '\r', '\t', '\b', '\f', '\', '"' while parsing JSON documents. Set to:

    • true to unescape these special characters (that is, '\n' will be replaced with new line, similarly other characters will also be replaced) in the output document.

    • false to keep these characters as is in the output document.

    Default value is true.

Output Parameters

  • document: Document - Document resulting from the conversion of jsonString.

List Services

Use List services to retrieve, replace, or add elements in an Object List, Document List, or String List, including converting String Lists to Document Lists.

The following List services are available:

Service Description
addItemToVector Adds an item or a list of items to a java.util.Vector object.
appendToDocumentList Adds documents to a document list.
appendToStringList Adds Strings to a String list.
sizeOfList Returns the number of elements in a list.
stringListToDocumentList Converts a String list to a document list.
vectorToArray Converts a java.util.Vector object to an array.

addItemToVector

Adds an item or a list of items to a java.util.Vector object.

Input Parameters

  • vector: java.util.Vector Optional - The vector object to which you want to add an item or list of items. If no value is specified, the service creates a new java.util.Vector object to which the item(s) will be added.
  • item: Object Optional - Item to be added to the vector object.
Note: NOTEYou can use either item or itemList to specify the input object. If both item and itemList input parameters are specified, the item as well as the list of items will be added to the vector object.
  • itemList: Object[ ] Optional - List of items to be added to the vector object.

  • addNulls: String Optional - Specifies whether a null item can be added to the vector object. Set to:

    • false to prevent null values from being added to the vector object. This is the default.

    • true to allow null values to be added to the vector object.

Output Parameters

  • vector: java.util.Vector - Updated vector object with the list of items added or an empty vector in case no items are added.

Usage Notes

Either of the optional input parameters, item or itemList, is required.

appendToDocumentList

Adds documents to a document list.

Input Parameters

  • toList: Document List Optional - List to which you want to append documents. If you do not specify toList, the service creates a new list.

  • fromList: Document List Optional - Documents you want to append to the end of toList.

  • fromItem: Document Optional - Document you want to append to the end of toList. If you specify both fromList and fromItem, the service adds the document specified in fromItem after the documents in fromList.

Output Parameters

  • toList: Document List - The toList document list with the documents in fromList and fromItem appended to it.

Usage Notes

The documents contained in fromList and fromItem are not actually appended as entries to toList. Instead, references to the documents in fromList and fromItem are appended as entries to toList. Consequently, any changes made to the documents in fromList and fromItem also affect the resulting toList.

appendToStringList

Adds Strings to a String list.

Input Parameters

  • toList: String List Optional - List to which you want to append Strings. If the value of toList is null, a null pointer exception error is thrown. If you do not specify toList, the service creates a new list.

  • fromList: String List Optional - List of Strings to add to toList. Strings are added after the entries of toList.

  • fromItem: String Optional - String you want to append to the end of toList. If you specify both fromList and fromItem, the service adds the String specified in fromItem after the Strings specified in fromList.

Output Parameters

  • toList: String List - The toList String list with the Strings from fromList and fromItem appended to it.

Usage Notes

The Strings contained in fromList and fromItem are not actually appended as entries to toList. Instead, references to the Strings in fromList and fromItem are appended as entries to toList. Consequently, any changes made to the Strings in fromList and fromItem also affect the resulting toList.

sizeOfList

Returns the number of elements in a list.

Input Parameters

  • fromList: Document List, String List, or Object List Optional - List whose size you want to discover. If fromList is not specified, the service returns a size of 0.

Output Parameters

  • size: String - Number of entries in fromList.

  • fromList: Document List, String List, or Object List - Original list.

Usage Notes

For example, if fromList consists of:

  • fromList[0] = "a"
  • fromList[1] = "b"
  • fromList[2] = "c"

The result would be:

  • size="3"

stringListToDocumentList

Converts a String list to a document list.

Input Parameters

  • fromList: String List Optional - List of Strings (a String[ ]) that you want to convert to a list of documents. If fromList is not specified, the service returns a zero length array for toList.

  • key: String Optional - Key name to use in the generated document list.

Output Parameters

  • toList: Document List - Resulting document list.

Usage Notes

Creates a document list containing one document for each element in the fromList. Each document will contain a single String element named key.

vectorToArray

Converts a java.util.Vector object to an array.

Input Parameters

  • vector: java.util.Vector - The object to be converted to an array.
  • stronglyType: String Optional - If this option is specified, the service expects all items in the vector to have the same Java type as the first non-null item in the vector. If the service detects an item of a different type, an error appears. Set to:
    • false to convert the vector to an object array. This is the default.
    • true to convert the vector to a strongly typed array holding the same type of objects.

Output Parameters

  • array: Object[ ] - Converted object array.

Math Services

Use Math services to perform mathematical operations on string-based numeric values. Services that operate on integer values use Java's long data type (64-bit, two's complement). Services that operate on float values use Java's double data type (64-bit IEEE 754). If extremely precise calculations are critical to your application, you should write your own Java services to perform math functions.

The following Math services are available:

Service Description
absoluteValue Returns the absolute value of the input number.
addFloatList Adds a list of floating point numbers (represented in a string list) and returns the sum.
addFloats Adds one floating point number (represented as a String) to another and returns the sum.
addIntList Adds a list of integers (represented in a String list) and returns the sum.
addInts Adds one integer (represented as a String) to another and returns the sum.
addObjects Adds one java.lang.Number object to another and returns the sum.
divideFloats Divides one floating point number (represented as a String) by another (num1/num2) and returns the quotient.
divideInts Divides one integer (represented as a String) by another (num1/num2) and returns the quotient.
divideObjects Divides one java.lang.Number object by another (num1/num2) and returns the quotient.
max Returns the largest number from a list of numbers.
min Returns the smallest number from a list of numbers.
multiplyFloatList Multiplies a list of floating point numbers (represented in a String list) and returns the product.
multiplyFloats Multiples one floating point number (represented as String) by another and returns the product.
multiplyIntList Multiplies a list of integers (represented in a String list) and returns the product.
multiplyInts Multiplies one integer (represented as a String) by another and returns the product.
multiplyObjects Multiplies one java.lang.Number object by another and returns the product.
randomDouble Returns the next pseudorandom, uniformly distributed double between 0.0 and 1.0.
roundNumber Returns a rounded number.
subtractFloats Subtracts one floating point number (represented as a String) from another and returns the difference.
subtractInts Subtracts one integer (represented as a String) from another and returns the difference.
subtractObjects Subtracts one java.lang.Number object from another and returns the difference.
toNumber Converts a string to numeric data type.

absoluteValue

Returns the absolute value of the input number.

Input Parameters

  • num: String - Number whose absolute value is to be returned.

Output Parameters

  • positiveNumber: String - Absolute value of the input number.

addFloatList

Adds a list of floating point numbers (represented in a string list) and returns the sum.

Input Parameters

  • numList: String List - Numbers (floating point numbers represented in a string list) to add.

Output Parameters

  • value: String - Sum of the numbers in numList. If a sum cannot be produced, value contains one of the following:

    • Infinity - The computation produces a positive value that overflows the representable range of a float type.
    • -Infinity- The computation produces a negative value that overflows the representable range of a float type.
    • 0.0 - The computation produces a value that underflows the representable range of a float type (for example, adding a number to infinity).
    • NaN - The computation produces a value that cannot be represented as a number (for example, any operation that uses NaN as input, such as 10.0 + NaN = NaN).

Usage Notes

Make sure the strings that are passed to the service in numList are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

addFloats

Adds one floating point number (represented as a String) to another and returns the sum.

Input Parameters

  • num1: String - Number to add.

  • num2: String - Number to add.

  • precision: String Optional - Number of decimal places to which the sum will be rounded. The default value is null.

Output Parameters

  • value: String - Sum of the numbers in num1 and num2. If a sum cannot be produced, value contains one of the following:

    • Infinity - The computation produces a positive value that overflows the representable range of a float type.

    • -Infinity - The computation produces a negative value that overflows the representable range of a float type.

    • 0.0 - The computation produces a value that underflows the representable range of a float type (for example, adding a number to infinity).

    • NaN - The computation produces a value that cannot be represented as a number (for example, any operation that uses NaN as input, such as 10.0 + NaN = NaN).

Usage Notes

Make sure the strings that are passed to the service in num1andnum2 are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

addIntList

Adds a list of integers (represented in a String list) and returns the sum.

Input Parameters

  • numList: String List - Numbers (integers represented as Strings) to add.

Output Parameters

  • value: String - Sum of the numbers in numList.

Usage Notes

Make sure the strings that are passed to the service in numList are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

addInts

Adds one integer (represented as a String) to another and returns the sum.

Input Parameters

  • num1: String - Number (integer represented as a String) to add.

  • num2: String - Number (integer represented as a String) to add.

Output Parameters

  • value: String - Sum of num1 and num2.

Usage Notes

Ensure that the result of your calculation is less than 64 bits in width (the maximum width for the long data type). If the result exceeds this limit, it will generate a data overflow.

Ensure that the strings that are passed to the service in num1andnum2 are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

addObjects

Adds one java.lang.Number object to another and returns the sum.

Input Parameters

  • num1: java.lang.Number - Number to add. See the Usage Notes for supported sub-classes.

  • num2: java.lang.Number - Number to add. See the Usage Notes for supported sub-classes.

Output Parameters

  • value: java.lang.Number - Sum of the numeric values of num1 and num2.

Usage Notes

This service accepts the following sub-classes of java.lang.Number: java.lang.Byte, java.lang.Double, java.lang.Float, java.lang.Integer, java.lang.Long, java.lang.Short.

This service applies the following rules for binary numeric promotion to the operands in order:

  • If either operand is of type Double, the other is converted to Double.
  • Otherwise, if either operand is of type Float, the other is converted to Float.
  • Otherwise, if either operand is of type Long, the other is converted to Long.
  • Otherwise, both operands are converted to type Integer.

These promotion rules mirror the Java rules for numeric promotion of numeric types.

divideFloats

Divides one floating point number (represented as a String) by another (num1/num2) and returns the quotient.

Input Parameters

  • num1: String - Number (floating point number represented as a String) that is the dividend.

  • num2: String - Number (floating point number represented as a String) that is the divisor.

  • precision: String Optional - Number of decimal places to which the quotient will be rounded. The default value is null.

Output Parameters

  • value: String - The quotient of num1 / num2. If a quotient cannot be produced, value contains one of the following:

    • Infinity - The computation produces a positive value that overflows the representable range of a float type.

    • -Infinity - The computation produces a negative value that overflows the representable range of a float type.

    • 0.0 - The computation produces a value that underflows the representable range of a float type (for example, dividing a number by infinity).

    • NaN - The computation produces a value that cannot be represented as a number (for example, the result of an illegal operation such as dividing zero by zero or any operation that uses NaN as input, such as 10.0 + NaN = NaN).

Usage Notes

Make sure the strings that are passed to the service in num1andnum2 are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

divideInts

Divides one integer (represented as a String) by another (num1/num2) and returns the quotient.

Input Parameters

  • num1: String - Number (integer represented as a String) that is the dividend.

  • num2: String - Number (integer represented as a String) that is the divisor.

Output Parameters

  • value: String - The quotient of num1 / num2.

Usage Notes

Make sure the strings that are passed to the service in num1andnum2 are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

divideObjects

Divides one java.lang.Number object by another (num1/num2) and returns the quotient.

Input Parameters

  • num1: java.lang.Number - Number that is the dividend. See the Usage Notes for supported sub-classes.

  • num2: java.lang.Number - Number that is the divisor. See the Usage Notes for supported sub-classes.

Output Parameters

  • value: java.lang.Number - Quotient of num1 / num2.

Usage Notes

This service accepts the following sub-classes of java.lang.Number: java.lang.Byte, java.lang.Double, java.lang.Float, java.lang.Integer, java.lang.Long, java.lang.Short.

This service applies the following rules for binary numeric promotion to the operands in order:

  • If either operand is of type Double, the other is converted to Double.
  • Otherwise, if either operand is of type Float, the other is converted to Float.
  • Otherwise, if either operand is of type Long, the other is converted to Long.
  • Otherwise, both operands are converted to type Integer.

These promotion rules mirror the Java rules for numeric promotion of numeric types.

max

Returns the largest number from a list of numbers.

Input Parameters

  • numList: String List - List of numbers from which the largest number is to be returned.

Output Parameters

  • maxValue: String - Largest number from the list of numbers.

min

Returns the smallest number from a list of numbers.

Input Parameters

  • numList: String List - List of numbers from which the smallest number is to be returned.

Output Parameters

  • minValue: String - Smallest number from the list of numbers.

multiplyFloatList

Multiplies a list of floating point numbers (represented in a String list) and returns the product.

Input Parameters

  • numList: String List - Numbers (floating point numbers represented as Strings) to multiply.

Output Parameters

  • value: String - Product of the numbers in numlist. If a product cannot be produced, value contains one of the following:

    • Infinity: The computation produces a positive value that overflows the representable range of a float type.

    • -Infinity: The computation produces a negative value that overflows the representable range of a float type.

    • 0.0 - The computation produces a value that underflows the representable range of a float type (for example, multiplying a number by infinity).

    • NaN - The computation produces a value that cannot be represented as a number (for example, the result of an illegal operation such as multiplying zero by zero or any operation that uses NaN as input, such as 10.0 + NaN = NaN).

Usage Notes

Make sure the strings that are passed to the service in numList are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

multiplyFloats

Multiples one floating point number (represented as String) by another and returns the product.

Input Parameters

  • num1: String - Number (floating point number represented as a String) to multiply.

  • num2: String - Number (floating point number represented as a String) to multiply.

  • precision: String Optional - Number of decimal places to which the product will be rounded. The default value is null.

Output Parameters

  • value: String - Product of the numeric values of num1 and num2. If a product cannot be produced, value contains one of the following:

    • Infinity - The computation produces a positive value that overflows the representable range of a float type.

    • -Infinity |The computation produces a negative value that overflows the representable range of a float type.

    • 0.0 |The computation produces a value that underflows the representable range of a float type (for example, multiplying a number by infinity).

    • NaN |The computation produces a value that cannot be represented as a number (for example, the result of an illegal operation such as multiplying zero by zero or any operation that uses NaN as input, such as 10.0 + NaN = NaN).

Usage Notes

Make sure the strings that are passed to the service in num1andnum2 are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

multiplyIntList

Multiplies a list of integers (represented in a String list) and returns the product.

Input Parameters

  • numList: String List - Numbers (floating point numbers represented as Strings) to multiply.

Output Parameters

  • value: String - Product of the numbers in numList.

Usage Notes

Make sure the result of your calculation is less than 64 bits in width (the maximum width for the long data type). If the result exceeds this limit, it will generate a data overflow.

Make sure the strings that are passed to the service in numList are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

multiplyInts

Multiplies one integer (represented as a String) by another and returns the product.

Input Parameters

  • num1: String - Number (integer represented as a String) to multiply.
  • num2: String - Number (integer represented as a String) to multiply.

Output Parameters

  • value: String - Product of num1 and num2.

Usage Notes

Make sure the result of your calculation is less than 64 bits in width (the maximum width for the long data type). If the result exceeds this limit, it will generate a data overflow.

Make sure the strings that are passed to the service in num1andnum2 are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

multiplyObjects

Multiplies one java.lang.Number object by another and returns the product.

Input Parameters

  • num1: java.lang.Number - Number to multiply. See the Usage Notes for supported sub-classes.
  • num2: java.lang.Number - Number to multiply. See the Usage Notes for supported sub-classes.

Output Parameters

  • value: java.lang.Number - Product of num1 and num2.

Usage Notes

This service accepts the following sub-classes of java.lang.Number: java.lang.Byte, java.lang.Double, java.lang.Float, java.lang.Integer, java.lang.Long, java.lang.Short.

This service applies the following rules for binary numeric promotion to the operands in order:

  • If either operand is of type Double, the other is converted to Double.
  • Otherwise, if either operand is of type Float, the other is converted to Float.
  • Otherwise, if either operand is of type Long, the other is converted to Long.
  • Otherwise, both operands are converted to type Integer.

These promotion rules mirror the Java rules for numeric promotion of numeric types.

randomDouble

Returns the next pseudorandom, uniformly distributed double between 0.0 and 1.0.

Random number generators are often referred to as pseudorandom number generators because the numbers produced tend to repeat themselves over time.

Input Parameters

  • fractionLength: String - Specifies the number of digits for the generated random number. For example, if you specify 7, the random number generated will be 0.6536596.

Output Parameters

  • number: String - Generated random number.

roundNumber

Returns a rounded number.

Input Parameters

  • num: String - Number to be rounded.
  • numberOfDigits: String - Specifies the number of digits to which you want to round the number.
  • roundingMode: String Optional - Specifies the rounding method. Valid values for the roundingMode parameter are RoundHalfUp , RoundUp, RoundDown, RoundCeiling, RoundFloor, RoundHalfDown, and RoundHalfEven. The default value is RoundHalfUp.

Output Parameters

  • roundedNumber: String - The rounded number.

subtractFloats

Subtracts one floating point number (represented as a String) from another and returns the difference.

Input Parameters

  • num1: String - Number (floating point number represented as a String).
  • num2: String - Number (floating point number represented as a String) to subtract from num1.
  • precision: String Optional - Number of decimal places to which the difference will be rounded. The default value is null.

Output Parameters

  • value: String - Difference of num1 - num2. If a difference cannot be produced, value contains one of the following:
  • Infinity - The computation produces a positive value that overflows the representable range of a float type.
  • -Infinity - The computation produces a negative value that overflows the representable range of a float type.
  • 0.0 - The computation produces a value that underflows the representable range of a float type (for example, subtracting a number from infinity).
  • NaN - The computation produces a value that cannot be represented as a number (for example, the result of an illegal operation such as multiplying zero by zero or any operation that uses NaN as input, such as 10.0 - NaN = NaN).

Usage Notes

Make sure the strings that are passed to the service in num1andnum2 are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

subtractInts

Subtracts one integer (represented as a String) from another and returns the difference.

Input Parameters

  • num1: String - Number (integer represented as a String).
  • num2: String - Number (integer represented as a String) to subtract from num1.

Output Parameters

  • value: String - Difference of num1 - num2.

Usage Notes

Make sure the result of your calculation is less than 64 bits in width (the maximum width for the long data type). If the result exceeds this limit, it will generate a data overflow.

Make sure the strings that are passed to the service in num1 andnum2 are in a locale-neutral format (that is, using the pattern -####.##). Passing locally formatted strings may result in unexpected results. For example, calling addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.

subtractObjects

Subtracts one java.lang.Number object from another and returns the difference.

Input Parameters

  • num1: java.lang.Number - Number. See the Usage Notes for supported sub-classes.
  • num2: java.lang.Number - Number to subtract from num1. See the Usage Notes for supported sub-classes.

Output Parameters

  • value: java.lang.Number - Difference of num1 - num2.

Usage Notes

This service accepts the following sub-classes of java.lang.Number: java.lang.Byte, java.lang.Double, java.lang.Float, java.lang.Integer, java.lang.Long, java.lang.Short.

This service applies the following rules for binary numeric promotion to the operands. The following rules are applied in order:

  • If either operand is of type Double, the other is converted to Double.
  • Otherwise, if either operand is of type Float, the other is converted to Float.
  • Otherwise, if either operand is of type Long, the other is converted to Long.
  • Otherwise, both operands are converted to type Integer.

These promotion rules mirror the Java rules for numeric promotion of numeric types.

toNumber

Converts a string to numeric data type.

Input Parameters

  • num: String - Number (represented as a string) to be converted to numeric format.
  • convertAs: String Optional - Specifies the Java numeric data type to which the num parameter is to be converted. Valid values for the convertAs parameter are java.lang.Double, java.lang.Float, java.lang.Integer, java.math.BigDecimal,java.math.BigInteger, java.lang.Long. The default value is java.lang.Double .

Output Parameters

  • num: java.lang.Number - Converted numeric object.

MIME Services

Use MIME services to create MIME messages and extract information from MIME messages.

The following MIME services are available:

Service Function
addBodyPart Adds a body part (header fields and content) to a specified MIME object.
addMimeHeader Adds one or more header fields to a specified MIME object.
createMimeData Creates a MIME object.
getBodyPartContent Retrieves the content (payload) from the specified MIME object.
getBodyPartHeader Returns the list of header fields for the specified body part.
getContentType Returns the value of the Content-Type message header from the specified MIME object.
getEnvelopeStream Generates an InputStream representation of a MIME message from a specified MIME object.
getMimeHeader Returns the list of message headers from a specified MIME object.
getNumParts Returns the number of body parts in the specified MIME object.
getPrimaryContentType Returns the top-level portion of a MIME object's Content-Type value.
getSubContentType Returns the sub-type portion of a MIME object's Content-Type value.
mergeHeaderAndBody Concatenates the contents of the header and body mapped to the input.
releaseBodyPartReferenceInTSpace Release a body part from the Tspace.

addBodyPart

Adds a body part (header fields and content) to a specified MIME object.

Input Parameters

  • mimeData: Document - MIME object to which you want to add a body part. (This IData object is produced by createMimeData).

  • content: java.io.InputStream or Object - Content that you want to add to the MIME object. content can be an InputStream or another MIME object. Use an InputStream to add an ordinary payload. Use a MIME object to add a payload that is itself a MIME message.

  • isEnvStream:String - Flag that specifies whether content is to be treated as a MIME entity.

Important: This parameter is only used if content is an InputStream.
Set this parameter to one of the following values:
  • yes to treat content as a MIME entity. addBodyPart will strip out the header fields from the top of content and add them to mimeData as part headers. The remaining data will be treated as the payload.
    Note: addBodyPart assumes that all data up to the first blank line represents the entity's header fields.- `no` to treat content as an ordinary payload.
  • no to treat content as an ordinary payload.
  • mimeHeader: Document - Specifies the part headers that you want to add with this body part. Key names represent the names of the header fields. The values of the keys represent the values of the header fields. For example, if you wanted to add the following header fields:

    • X-Doctype: RFQ

    • X-Severity: 10

    You would set mimeHeader as follows:

    key Value
    X-Doctype RFQ
    X-Severity 10

    Be aware that the following MIME headers are automatically inserted by getEnvelopeStream when it generates the MIME message:

    • Message-ID

    • MIME-Version

    Additionally, you use the content, encoding, and description parameters to set the following fields:

    • Content-Type

    • Content-Transfer-Encoding

    • Content-Description

    If you set these header fields in mimeHeader and you create a single-part message, the values in contenttype, encoding, and description, if specified, will override those in mimeHeader. See usage notes.

  • contenttype: String Optional - The value of the Content-Type header for this body part. For single-part messages, this value overrides the Content-Type value in mimeHeader, if one is present. Defaults to text/plain. See usage notes.

  • encoding: String Optional - Specifies how the body part is to be encoded for transport and sets the value of the Content-Transfer-Encoding header. For single-part messages, this value overrides the Content-Transfer-Encoding value in mimeHeader, if one is present. Defaults to 7bit. See usage notes.

Note: This parameter determines how the payload is to be encoded for transport. When you add a payload to mimeData, it should be in its original format. The getEnvelopeStream service will perform the encoding (as specified by encoding) when it generates the final MIME message.
Set to:
  • `7bit` to specify that content is 7-bit, line-oriented text that needs no encoding. This is the default.
  • `8bit` to specify that content is 8-bit, line-oriented text that needs no encoding.
Note: This encoding value is not recommended for messages that will be transported via SMTP over the Internet, because the data can be altered by intervening mail servers that can't accommodate 8-bit text. To safely transport 8-bit text, use quoted-printable encoding instead.
  • `binary` to specify that content contains binary information that needs no encoding.
Note: This encoding value is not recommended for messages that will be transported via SMTP over the Internet, because the data can be altered by intervening mail servers that can't accommodate binary data. To safely transport binary data, use base64 encoding instead.
  • quoted-printable` to specify that content contains 7 or 8-bit, line-oriented text that you want to encode using the quoted-printable encoding sheme.
  • `base64` to specify that content contains an arbitrary sequence of octets that you want to encode using the base64 encoding scheme.
  • `uuencode` to specify that content contains an arbitrary sequence of octets that you want to encode using the uuencode encoding scheme.
  • description: String Optional - Specifies the value of the Content-Description header for this body part.

  • multipart: String Optional - Flag that determines how addBodyPart behaves if mimeData already contains one or more body parts. By default, addBodyPart simply appends a new body part to mimeData if it already contains a payload. (This allows you to construct multi-part messages.) However, you can override this behavior if you want to either replace the existing payload with the new body part or throw an exception under these circumstances (see replace parameter, below). Set to:

    • yes to append a new body part to mimeData. This is the default.

    • no to replace the existing payload with the new body part. (Depending on the value of replace, this setting may cause addBodyPart to throw an exception.)

  • replace: String Optional - Flag that specifies whether addBodyPart replaces the existing payload or throws an exception when it receives a mimeData that already contains a payload. This parameter is only used when multipart is set to no. Set to:

    • yes to replace the existing payload with the new body part. This is the default.

    • no to throw an exception.

Output Parameters

  • mimeData: Document - MIME object to which the body part was added.

Usage Notes

This service operates on the MIME object (mimeData) produced by createMimeData.

The way in which the contenttype and encoding parameters are applied depends on whether the finished message is single-part or multipart.

For single-part messages:

  • contenttype specifies the Content-Type for the entire MIME message. It overrides any value assigned to the Content-Type header in mimeHeader. If Content-Type is not specified in contenttype or mimeHeader, the value of the Content-Type header defaults to text/plain.

  • encoding specifies the Content-Transfer-Encoding for the entire MIME message. It overrides any value assigned to the Content-Transfer-Encoding header in mimeHeader. If Content-Transfer-Encoding is not specified in encoding or mimeHeader, the value of the Content-Transfer-Encoding header defaults to 7bit.

For multipart messages:

  • contenttype specifies the Content-Type for an individual body part. The Content-Type for the entire MIME message is automatically set to multipart/mixed, or to multipart/subType if a subtype was specified when the MIME object was created. See createMimeData.

  • encoding specifies the Content-Transfer-Encoding for an individual body part. The Content-Transfer-Encoding header in mimeHeader, if present, specifies the encoding for the entire MIME message. If Content-Transfer-Encoding is not specified in mimeHeader, or if the specified value is not valid for a multipart message, the value of the Content-Transfer-Encoding header defaults to 7bit. (7bit, 8bit, and binary are the only encoding values valid for multipart messages.)

addMimeHeader

Adds one or more header fields to a specified MIME object.

Input Parameters

  • mimeData: Document - MIME object to which you want the header fields added. (This IData object is produced by createMimeData).

  • mimeHeader: Document - Header fields that you want to add to the MIME object. Key names represent the names of the header fields. The values of the keys represent the values of the header fields. For example, to add the following header fields:

    • X-Doctype: RFQ

    • X-Severity: 10

    You would set mimeHeader as follows:

    key Value
    X-Doctype RFQ
    X-Severity 10

    Be aware that the following MIME headers are automatically inserted by getEnvelopeStream when it generates the MIME message:

    • Message-ID

    • MIME-Version

    If you set these values in mimeHeader, getEnvelopeStream will overwrite them at run time.

Output Parameters

  • mimeData: Document - MIME object to which the header fields were added.

Usage Notes

This service operates on the MIME object (mimeData) produced by createMimeData.

If you add MIME headers before you add multiple body parts, the header fields will be added to each of the body parts. If you do not want this behavior, either drop mimeHeader from the pipeline immediately after you execute addMimeHeader, or invoke addMimeHeader after you've added all body parts to the MIME object.

Be aware that the contenttype and encoding parameters used by the addBodyPart service will override any Content-Type or Content-Transfer-Encoding settings in mimeData. Moreover, in certain cases, the getEnvelopeStream will override these settings when it generates a multipart message. For information about how the Content-Type or Content-Transfer-Encoding headers are derived at run time, see the Usage Notes under addBodyPart.

createMimeData

Creates a MIME object.

If no input parameter is passed to this service, the service creates an empty MIME object. Otherwise, the service creates a MIME object containing the elements (header fields and content) from the MIME message in input.

  • If you are building a MIME message, you use this service to create an empty MIME object. You populate the empty MIME object with header fields and content, and then pass it to getEnvelopeStream, which produces the finished MIME message.

  • If you are extracting data from a MIME message, you use this service to parse the original MIME message into a MIME object so that you can extract its header fields and content using other services.

Input Parameters

  • input: java.io.InputStream Optional - MIME entity you want to parse. If input is not provided, createMimeData creates an empty MIME object.

  • mimeHeader: Document Optional - Specifies header fields that you want to add to the MIME object. Key names represent the names of the header fields. The values of the keys represent the values of the header fields.

Note: This parameter is ignored when input is passed to this service.
For example, if you wanted to add the following header fields:
  • Doctype: RFQ
  • Severity: 10

You would set mimeHeader as follows:

key Value
X-Doctype RFQ
X-Severity 10
Be aware that the following MIME headers are automatically inserted by getEnvelopeStream when it generates the MIME message:
  • Message-ID
  • MIME-Version
If you set these values in mimeHeader, getEnvelopeStream will overwrite them at run time.
  • subType: String Optional - String that specifies the subtype portion of the Content Type header, when the message is a multipart message and you want something other than the default value of mixed. For example, if you want the Content Type header to be multipart/related in the resulting message, set subType to related. subType is ignored if the resulting message is not a multipart message.

  • decodeHeaders: String Optional - Specifies how the MIME header is to be decoded. Set to:

    • " "(empty String) to decode headers based on the value of the global watt property watt.server.mime.decodeHeaders. This is the default.

    • NONE to specify that the MIME header or body part headers do not need decoding.

    • ONLY_MIME_HEADER to decode the MIME header only.

    • ONLY_BODY_PART_HEADERS to decode the body part headers only.

    • BOTH to decode the MIME header and the body part headers.

Output Parameters

  • mimeData: Document - MIME object. If input was passed to createMimeData, mimeData will contain the parsed MIME message. If input was not passed to createMimeData, mimeData will be empty.

  • encrypted: String Conditional - Indicates whether input was an encrypted message. This parameter is not present when the service creates a new, empty MIME object. A value of:

    • true indicates that the message is encrypted (the original message stream is in stream).

    • false indicates that the message is not encrypted.

  • signed: String Conditional - Flag whose value indicates whether input was a signed message. This parameter is not present when the service creates a new, empty MIME object. A value of:

    • true indicates that the message is signed (the original message stream is in stream).

    • false indicates that the message is not signed.

  • certsOnly: String Conditional - Flag whose value indicates whether input contained only digital certificates. This parameter is not present when the service creates a new, empty MIME object. A value of:

    • true indicates that the message contains only certificates.

    • false indicates that the message contains a regular payload.

  • stream: java.io.InputStream Conditional - InputStream containing the original MIME message from input. This parameter is present only when input is an S/MIME message.

Usage Notes

All of the other MIME services operate on the mimeData IData object produced by this service. They do not operate directly on MIME message streams.

Important: You can examine the contents of mimeData during testing and debugging. However, because the internal structure of mimeData is subject to change without notice, do not explicitly set or map data to/from these elements in your service. To manipulate or access the contents of mimeData, use only the MIME services that is provided.

getBodyPartContent

Retrieves the content (payload) from the specified MIME object.

You use this service for both single-part and multi-part messages.

To retrieve content from a multi-part message, you set the index (to select the part by index number) or contentID (to select the part by contentID value) parameter to specify the body part whose content you want to retrieve. To get the content from a single-part message, you omit the index and contentID parameters or set index to 0.

Input Parameters

  • mimeData: Document - MIME object whose content you want to retrieve. (This IData object is produced by createMimeData).

  • index: String Optional - Index number of the body part whose content you want to retrieve (if you want to retrieve the content from a specific body part). The first body part is index number zero.

Note: If contentID is specified, index is ignored.
  • contentID: String Optional - Value of the Content-ID header field of the body part whose content you want to retrieve (if you want to retrieve the payload from a specific body part).

Output Parameters

  • content: IData - The payload of the specified body part.

  • encrypted: String - Flag whose value indicates whether content is an encrypted MIME message. A value of:

    • true indicates that content is an encrypted message.

    • false indicates that content is not an encrypted message.

  • signed: String - Flag indicating whether content is a signed MIME message. A value of:

    • true indicates that content is a signed MIME message.

    • false indicates that content is not a signed MIME message.

  • certsOnly String - Flag whose value indicates whether content is a certs-only MIME message. A value of:

    • true indicates that content is a certs-only message.

    • false indicates that content is not a certs-only message.

Usage Notes

This service operates on the MIME object (mimeData) produced by createMimeData.

If you omit index or contentID when retrieving content from a multi-part message, getBodyPartContent returns the payload from the first body part. If you use index or contentID to select a body part that does not exist in mimeData, content will be null.

getBodyPartHeader

Returns the list of header fields for the specified body part.

Input Parameters

  • mimeData:Document - MIME object whose message headers you want to retrieve. (This IData object is produced by createMimeData).
  • index: String Optional - Index number of the body part whose header fields you want to retrieve. The first body part is index zero.
Note: If contentID is specified, index is ignored.
  • contentID: String Optional - Value of the Content-ID header field of the body part whose header fields you want to retrieve.

  • decodeHeaders: String Conditional - Flag whose value indicates whether to decode encoded headers in the MIME object. Set to:

    • true to indicate that the headers should be decoded.

    • false to indicate that the headers should not be decoded. This is the default.

Output Parameters

  • mimeHeader: Document - IData object containing the message headers. Key names represent the names of the header fields. The value of a key represents the value of that header field. For example, if the original message contained the following message header fields:

    • Content-Type: text/xml
    • X-Doctype: RFQ
    • X-Severity: 0
Key Value
Content-Type `text/xml`
X-Doctype `RFQ`
X-Severity `0`

Usage Notes

This service operates on the MIME object (mimeData) produced by createMimeData.

If you omit index or contentID, getBodyPartHeader returns the message headers from the first body part. If you use index or contentID to select a body part that does not exist in mimeData, content will be null.

getContentType

Returns the value of the Content-Type message header from the specified MIME object.

Input Parameters

  • mimeData: Document - MIME object whose Content-Type you want to discover (This IData object is produced by createMimeData).

Output Parameters

  • contentType: String - Value of the MIME object's Content-Type header field. Note that this service returns only the media type and subtype portion of this header field's value. It does not return any parameters the value may include. For example, if the message's Content-Type header were:

    • Content-Type: text/plain;charset=UTF8

    contentType would contain:

    • text/plain

Usage Notes

This service operates on the MIME object (mimeData) produced by createMimeData.

getEnvelopeStream

Generates an InputStream representation of a MIME message from a specified MIME object.

Input Parameters

  • mimeData: Document - MIME object from which you want to generate the MIME message(This IData object is produced by createMimeData).
  • index: String Optional - Index number of the body part for which you want to generate the MIME message (if you want to generate the message from a specific body part). The first body part is index number zero.
  • contentID: String Optional - Value of the Content-ID header field of the body part from which you want to generate the MIME message (if you want to generate the message from a specific body part).
Note: If index is specified, contentID is ignored.
  • returnMimeMessage: String. Optional. Specifies whether the MIME message is returned as a javax.mail.internet.MimeMessage object when any of the body parts in the message exceed the large data threshold. Set to: - yes to return the MIME message in the mimeMessage output parameter as a MimeMessage when the large data threshold is exceeded. This is the default. - no to return the MIME message as an InputStream in the envStream output parameter when the large data threshold is exceeded.

  • suppressHeaders: String List Optional - Names of header fields that are to be omitted from message. You can use this option to exclude header fields that getEnvelopeStream generates by default, such as Content-Type and content-encoding.

  • createMultipart: String Optional - Specifies whether a multipart message is to be created, even if mimeData contains only one body part. Set to:

    • yes to create a multipart message (Content-Type message header is set to "multipart/mixed").

    • no to create a message based on the number of body parts in mimeData. This is the default.

      If the message contains only one body part, Content-Type is set according to the contenttype setting specified when that body part was added to mimeData.

      If the message contains multiple body parts, Content-Type is automatically set to "multipart/mixed."

Output Parameters

  • envStream: java.io.InputStream - The MIME message as an InputStream.

  • mimeMessage: javax.mail.internet.MimeMessage. Conditional. This service returns a mimeMessage instead of an envStream if any of the body parts have data mimeMessage greater than the specified threshold.

Usage Notes

This service operates on the MIME object (mimeData) produced by createMimeData.

If you omit index or contentID, getEnvelopeStream generates the MIME message from the entire contents of the mimeData. If you use index or contentID to select a body part that does not exist in mimeData, content will be null.

getEnvelopeStream automatically inserts the MIME-Version and Message-ID message headers into the MIME message it puts into envStream.

getMimeHeader

Returns the list of message headers from a specified MIME object.

Input Parameters

  • mimeData: Document - MIME object whose message headers you want to retrieve (This IData object is produced by createMimeData).

Output Parameters

  • mimeHeader: Document Conditional - An IData object containing the message headers. Key names represent the names of the header fields. The value of a key represents the value of the header fields. For example, if the original message contained the following message header fields:

     Message-ID: <002e01c0f150$6f33010a@sgx.com>
                                From: "Purch01@GSX.com" <Purch01@GSX.com>To:
                                <EXPEst@exprint.com>
                                MIME-Version: 1.0
                                Content-Type: text/xml
                                X-Doctype: RFQ
                                X-Severity: 0

    getMimeHeader would return the following:

    Key Value
    Message-ID <002e01c0f150$6f33010a@sgx.com>
    From "Purch01@GSX.com" <Purch01@GSX.com>
    To <EXPEst@exprint.com>
    MIME-Version 1.0
    Content-Type text/xml
    X-Doctype RFQ
    X-Severity 0

Usage Notes

This service operates on the MIME object (mimeData) produced by createMimeData.

getNumParts

Returns the number of body parts in the specified MIME object.

Input Parameters

  • mimeData:Document - MIME object whose parts you want to count (This IData object is produced by createMimeData).

Output Parameters

  • numParts: String - The number of body parts in the MIME object.

Usage Notes

This service operates on the MIME object (mimeData) produced by createMimeData.

getPrimaryContentType

Returns the top-level portion of a MIME object's Content-Type value.

Input Parameters

  • mimeData: Document - MIME object whose Content-Type you want to discover (This IData object is produced by createMimeData).

Output Parameters

  • primContentType: String - Message's top-level Content-Type. For example, if the message's Content-Type header were:

    • Content-Type: multipart/mixed

    primContentType would contain:

    • multipart

Usage Notes

This service operates on the MIME object (mimeData) produced by createMimeData.

getSubContentType

Returns the sub-type portion of a MIME object's Content-Type value.

Input Parameters

  • mimeData: Document - MIME object whose sub-type you want to discover (This IData object is produced by createMimeData).

Output Parameters

  • subContentType: String - Message's sub-type. For example, if the message's Content-Type header were:

    • Content-Type: multipart/mixed

    primContentType would contain:

    • mixed

Usage Notes

This service operates on the MIME object (mimeData) produced by createMimeData.

mergeHeaderAndBody

Concatenates the contents of the header and body mapped to the input.

You can use this service to reassemble the message into its original form so that it can be used as input to the createMimeData service (or any other service that requires the entire http response as an InputStream).

Input Parameters

  • headerLines: Document - IData object containing the message headers (The message headers are returned in the lines document inside the header output parameter).

  • body: Document - IData object containing the body of the message. This document must contain the body of the message in one of the following keys:

    • bytes: byte[ ] Optional - Body of the message.

    • stream: java.io.InputStream Optional - The body of the message.

Output Parameters

  • stream: java.io.InputStream - InputStream containing the reassembled tap message.

Usage Notes

Use this service to merge the Headers and Body to get the original MIME message.

releaseBodyPartReferenceInTSpace

This service enables you to free up space in the Tspace by releasing body parts stored in it by the pub.mime:addBodyPart service. You need to provide a reference to the body part to be released.

Input Parameters

mimeData: Document. MIME object whose reference you want to release from the Tspace. (This IData object is produced by pub.mime:createMimeData.)

index: String. Optional. Index number of the body part whose content you want to release (if you want to release the content from a specific body part). The first body part is index number zero. Note: If contentID is specified, index is ignored.

contentID: String. Optional. Value of the Content-ID header field of the body part that you want to release (if you want to release the payload from a specific body part).

Output Parameters

releasedReferenceInTSpace: Boolean. Returns true if the reference was released and false if not.

Usage Notes

Before invoking this service, ensure that the body part has a reference in the Tspace.

Schema Services

Use Schema services to validate objects and to validate the pipeline.

The following Schema services are available:

Service Description
validate Validates an object using an IS document type or a schema.
validatePipeline Validates the pipeline against a document type.

validate

Validates an object using an IS document type, XML document type, or an IS schema. .

Input Parameters

  • object: Document. Where Document is an IData to be validated.

  • conformsTo: Select the list of document types from the project.

  • maxErrors: String. Optional. Number of errors to be collected. Default value is 1. When the number of errors found is equal to maxErrors, the validation processor stops validation and returns the result. If maxErrors is set to -1, the validation processor returns all errors.

  • ignoreContent: String. Optional. Flag that specifies whether the validation processor will validate content keys of the type String or String List. Set to:

    • true to ignore content (that is, do not validate keys of these types).
    • false to validate content. This is the default.
  • failIfInvalid: String. Optional. Flag that indicates whether the service should fail and throw an exception if the object is invalid. Set to:

    • true to indicate that the service should fail if the object is invalid.
    • false to indicate that service should signal success and return errors to the pipeline if the object is invalid. This is the default. .

Output Parameters

  • isValid: String. Flag that indicates whether or not the validation was successful. A value of:

    • true indicates that the validation was successful.
    • false indicates that the validation was unsuccessful.
  • errors: Document List. Errors encountered during validation. Each document will contain the following information:

    • pathName: String. Location of the error in XQL.
    • errorCode: String. Error code (for example, VV-001).
    • errorMessage: String. Error message (for example, Missing Object).

Usage Notes

  • When validating supplied XML against an IS document type, IBM webMethods Integration uses the Java regular expression compiler by default.
  • When validating against an IS document type, if the Allow null property is set to false for a field in the document type and the corresponding element in the instance document carries the attribute xsi:nil, IBM webMethods Integration displays the [] Undefined Object found error.
  • When validating against an IS document type, if the Allow null property is set to false for a field in the document type and the corresponding element in the instance document contains content or contains child elements, IBM webMethods Integration displays the [] FieldName cannot have content or child elements since xsi:nil is true error.
  • When validating XML, IBM webMethods Integration uses the W3C recommendation XML Schema Part 2: Datatypes.

validatePipeline

Validates the pipeline against a document type.

Input Parameters

  • conformsTo: Select the list of document types of a project.

  • maxErrors: String. Optional. Number of errors to be collected. Default value is 1. When the number of errors found is equal to maxErrors, the validation processor stops validation and returns the result. If maxErrors is set to -1, the validation processor returns all errors.

  • ignoreContent: String. Optional. Flag that specifies whether the validation processor will validate content keys of the type String, String List, or String Table. Set to:

    • true to ignore content (that is, do not validate keys of these types).
    • false to validate content. This is the default.
  • failIfInvalid: String. Optional. Flag that indicates whether the service should fail and throw an exception if the object is invalid. Set to:

    • true to indicate that service should fail if object is invalid.
    • false to indicate that service should simply signal success and return errors to the pipeline if object is invalid. This is the default.

Output Parameters

  • isValid: String. Flag that indicates whether or not the validation was successful. A value of:

    • true indicates that the validation was successful.
    • false indicates that the validation was unsuccessful.
  • errors: Document List. Errors encountered during validation. Each document will contain the following information:

    • pathName: String. Location of the error in XQL.
    • errorCode: String. Error code (for example, VV-001).
    • errorMessage: String. Error message (for example, Missing Object).

Storage Services

Use Storage services to insert, retrieve, update, and remove entries from a data store.

When using the storage services, keep in mind that the short-term store is not intended to be used as a general-purpose storage engine. Rather, it is primarily provided to support shared storage of application resources and transient data in IBM webMethods Integration. It is recommended not to use the short-term store to process high volumes, large data records, or to permanently archive records.

Note: User specific data which may be considered as personal data will be stored and retained till the retention period defined in Execution Results.

These services are a tool for maintaining state information in the short-term store. It is up to the developer of the flow service to make sure that the flow service keeps track of its state and correctly handles restarts.

Locking Considerations

The following sections describe in general how the storage services handle locking requests.

Entry Locking

To maintain data integrity, the short-term store uses locking to ensure that multiple threads do not modify the same entry at the same time. For insertions and removals, the short-term store sets and releases the lock. For updates, the client must set and release the lock. Using locking improperly, that is, creating a lock but not releasing it, can cause deadlocks in the short-term store.

The following guidelines can help you avoid short-term store deadlocks:

  • Release locks in the thread through which they were set. In other words, you cannot set a lock in one thread and release it in another. The safest way to do this is to release each lock in the flow service that acquired it.
  • Unlock entries before the flow service completes. Entries remain locked until released using a put or an explicit unlock. To accomplish this, always pair a call to get or lock with a call to put or unlock so that every lock is followed by an unlock. In addition, use a try-catch pattern in your flow service so that an exception does not prevent the flow service from continuing and releasing the lock.

Data Store Locking

When a storage service locks an entry, the service also implicitly locks the data store in which the entry resides. This behavior prevents another thread from deleting the entire data store and the entries it contains while your thread is working with the entry. When the locked entry is unlocked, the implicit lock on the data store is also released.

Be careful when explicitly unlocking data stores. Consider the following example:

  1. User_A locks an item. This creates two locks: an explicit lock on the entry, and an implicit lock on the data store.

  2. User_A later unlocks the data store explicitly while still holding the lock on the entry.

  3. User_B locks, then deletes the data store, including the entry locked by User_A in the first step.

When User_A explicitly unlocked the data store in step 2, User_B was able to delete the entry the User_A was working with.

Automatic Promotion to Exclusive Lock

If a storage service tries to acquire an exclusive lock on an object, but finds a shared lock from the same thread already in place on the object, the service will try to promote the lock to an exclusive lock.

If a storage service that requires an exclusive lock encounters a shared or exclusive lock held by another thread, it will wait until the object becomes available. If the object remains locked for the period specified by the waitlength parameter passed by the service, the service will fail.

Sample Flow service for Checkpoint Restart

The following diagram shows how to create checkpoint restarts into your flow services. It explains the logic of a flow service and shows where the various storage services are used to achieve checkpoint restarts.

The following Storage services are available:

Service Description
add Inserts a new entry into a data store.
deleteStore Deletes a data store and all its contents. Any data in the data store is deleted. If the data store does not exist, the service takes no action.
get Retrieves a value from a data store and locks the entry and the data store on behalf of the thread that started the service.
keys Obtains a list of all the keys in a data store.
lock Locks an entry and/or data store on behalf of the thread invoking this service.
put Inserts or updates an entry in a data store. If the key does not exist in the data store, the entry is inserted.
remove Removes an entry from a data store.
unlock Unlocks an entry or a data store.

add

Inserts a new entry into a data store.

If the key already exists in the data store, the service does nothing.

Input Parameters

  • storeName: String - Name of the data store in which to insert the entry.

  • key: String - Key under which the entry is to be inserted.

  • value: Document - Value to be inserted.

Output Parameters

  • result: String - Flag indicating whether the entry was successfully added.

    A value of:

    • true indicates that the new entry was inserted successfully.
    • false indicates that the entry was not inserted (usually because an entry for key already exists).
  • error: String - Error message generated while inserting the new entry into the data store.

deleteStore

Deletes a data store and all its contents. Any data in the data store is deleted. If the data store does not exist, the service takes no action.

Input Parameters

  • storeName: String - Name of the data store to delete.

  • waitLength: String Optional - Length of time, in milliseconds, that you want to wait for this data store to become available for deletion if it is already locked by another thread.

Output Parameters

  • count: String - Number of data store entries that were deleted. If the store does not exist, this value is 0.

Usage Notes

This service obtains an exclusive lock on the data store, but no locks on the individual entries in the data store. If this service finds a shared lock from the same thread on the data store, the service will automatically promote the lock to an exclusive lock. The exclusive lock prevents other threads from acquiring locks on the data store or entries within the data store during the delete operation.

get

Retrieves a value from a data store and locks the entry and the data store on behalf of the thread that started the service.

Important: This service does not automatically release the lock on the data store or entry after performing the get operation, so you need to ensure that the lock is released by calling the put or unlock services. If you do not release the lock, IBM webMethods Integration will release the lock at the end of the flow service execution.

Input Parameters

  • storeName: String - Name of the data store from which you want to retrieve the entry.

  • key: String - Key of the entry whose value you want to retrieve.

  • waitLength: String Optional - Length of time, in milliseconds, that you want to wait for this entry to become available if it is already locked by another thread.

  • lockMode: String Optional - Type of lock you want to place on the entry.

    Set to:

    • Exclusive - To prevent other threads from reading or updating the entry while you are using it. The service also obtains a shared lock on the data store. An exclusive lock on an entry allows you to modify the entry.

    • Read - Is obsolete. If this value is specified, the service obtains a shared lock.

    • Share - To prevent other threads from obtaining an exclusive lock on the entry. The service also obtains a shared lock on the data store. A shared lock on an entry allows you to read, but not modify, the entry. This is the default.

Output Parameters

  • value: Document - Retrieved entry. If the requested entry does not exist, the value of this parameter is null.

Usage Notes

  • If you request an exclusive lock and the service finds a shared lock from the same thread on the entry, the service will automatically promote the shared lock on the entry to an exclusive lock.

  • When this service locks an entry, it also acquires a shared lock on the associated data store to prevent another thread from deleting the data store, and the entries it contains, while your thread has the entry locked.

  • When storing and retrieving the flow state in the short-term store for checkpoint restart purposes, ensure that the value of key is unique to the transaction.

keys

Obtains a list of all the keys in a data store.

Input Parameters

  • storeName: String - Name of the data store from which you want to obtain a list of keys.

Output Parameters

  • keys[]: String List - Keys for the data store specified in storeName.

lock

Locks an entry and/or data store on behalf of the thread invoking this service.

Important: When you lock an entry or data store using this service, you must release the lock by using a put or an explicit unlock. If you do not release the lock, IBM webMethods Integration will release the lock at the end of the flow service execution. Further, be careful when releasing locks with the unlock service. If you release a lock on a data store, another thread can obtain a lock on the data store and delete it, and the entries it contains, even if your thread still has locks on one or more of the entries.

Input Parameters

  • storeName: String - Name of the data store containing the entry.

  • key: String Optional - Key of the entry that you want to lock. If key is not supplied and you request:

    • A shared lock, the service obtains a shared lock on the data store, allowing other threads to read and modify entries, but not to delete them.
    • An exclusive lock, the service obtains an exclusive lock on the data store, preventing other threads from locking the data store and the entries, thereby preventing those threads from reading, modifying, or deleting the entries or the data store.

    If both storeName and key are specified and you request:

    • A shared lock, the service obtains a shared lock on the data store and the entry.
    • An exclusive lock, the service obtains a shared lock on the data store and an exclusive lock on the entry.
  • waitLength: String Optional - Length of time, in milliseconds, that you want to wait for this entry to become available if it is already locked by another thread.

  • lockMode: String Optional - Type of lock you want to place on the entry or data store.

    Set to:

    • Exclusive - To prevent other threads from obtaining a lock on the data store or entry. An exclusive lock on an entry allows you to modify the entry, and prevents other threads from reading or modifying the entry. An exclusive lock on a data store also locks the entries in the data store. In addition, an exclusive lock on a data store allows you to delete the data store.

    • Read - Is obsolete. If this value is specified, the service obtains a shared lock.

    • Share - To prevent other threads from obtaining an exclusive lock on an entry or a data store. A shared lock on an entry allows you to read, but not modify, the entry. A shared lock on a data store prevents another thread from deleting the data store. This is the default.

Output Parameters

None.

Usage Notes

  • If you have not specified a key, and your flow service does not invoke put or unlock, or your flow service throws an exception before invoking put or unlock, the entire data store remains locked.
  • If the key does not exist in the data store at the time your flow service executes, the lock service inserts the key with an empty value and takes the lock on the entry.
  • If you request an exclusive lock on an entry, the service obtains an exclusive lock on the entry and a shared lock on the data store. If this service finds a shared lock from the same thread on the entry, the service will automatically promote the shared lock on the entry to an exclusive lock.
  • If you request a shared lock on an entry, the service obtains a shared lock on the entry and a shared lock on the data store.
  • If you request a shared lock on an entry or a data store and this service finds an exclusive lock from the same thread, the existing exclusive lock will be reused. The exclusive lock will not be demoted to a shared lock.
  • If you request an exclusive lock on a data store, and this service finds a shared lock from the same thread on the data store, the service will automatically promote the shared lock on the data store to an exclusive lock.

put

Inserts or updates an entry in a data store. If the key does not exist in the data store, the entry is inserted.

If the requested entry is not currently locked by the thread that started this service, the put service will automatically attempt to lock the entry for the duration of the put operation.

The service obtains an exclusive lock on the entry and a shared lock on the data store. If the service finds a shared lock from the same thread on the entry, the service will automatically promote the shared lock to an exclusive lock.

This service releases the lock when the put operation has completed.

Input Parameters

  • storeName: String - Name of the data store into which you want to insert or update the entry.

  • key: String - Key where you want to insert or update the entry.

  • value: Document - Value to be inserted or updated.

  • waitLength: String Optional - Length of time, in milliseconds, that you want to wait for this entry to become available if it is already locked by another thread. If the wait length expires before a lock is obtained, the service fails and throws an exception. This parameter is used only when your service did not explicitly lock the entry beforehand.

Output Parameters

  • error: String - Error message generated while inserting the new entry into the data store.

Usage Notes

When storing and retrieving the flow state in the short-term store for checkpoint restart purposes, ensure that the value of key is unique to the transaction.

remove

Removes an entry from a data store. This service obtains an exclusive lock on the entry and a shared lock on the data store.

Input Parameters

  • storeName: String - Name of the data store from which to remove an entry.

  • key: String - Key of the entry that you want to remove.

  • waitLength: String Optional - Length of time, in milliseconds, that you want to wait for this entry to become available for deletion if it is already locked by another thread.

Output Parameters

  • result: String - Flag indicating whether the entry was successfully removed.

    A value of:

    • true indicates that the entry was removed successfully.

    • false indicates that the entry was not removed (usually because an entry for key does not exist).

unlock

Unlocks an entry or a data store.

When a flow service retrieves an entry using the get service, the entry is locked to prevent modification by other users before the flow service completes. The entry remains locked until the lock owner invokes a put service. To unlock a service without using the put service, use the unlock service.

In addition, if a flow service uses the lock service to lock an entry or data store, you must use the unlock or put service to release the lock.

Important: Be careful when releasing locks with this service. If you release a lock on a data store, another thread can obtain a lock on the data store and delete it, and the entries it contains, even if the original thread still has locks on one or more of the entries.

Input Parameters

  • storeName: String - Name of the data store in which to unlock an entry.

  • key: String Optional - Key of the entry that you want to unlock. If key is not supplied, the lock will be removed from the data store specified in storeName, but any locks on entries in the data store will remain.

Output Parameters

None.

String Services

Use String services to perform string manipulation and substitution operations.

The following String services are available:

Service Description
base64Decode Decodes a Base-64 encoded string into a sequence of bytes.
base64Encode Converts a sequence of bytes into a Base64-encoded String.
bytesToString Converts a sequence of bytes to a String.
compareStrings Performs a case-sensitive comparison of two strings, and indicates whether the strings are identical.
concat Concatenates two strings.
fuzzyMatch A given string is not exactly matched against a set of strings. If the match is above similarityThreshold, it returns the matchedValue. If more than one string has not exactly matched, then the first matched string is returned.
HTMLDecode Replaces HTML character entities with native characters.
HTMLEncode Replaces HTML-sensitive characters with equivalent HTML character entities.
indexOf Returns the index of the first occurrence of a sequence of characters in a string.
isAlphanumeric Determines whether a string consists entirely of alphanumeric characters (in the ranges A–Z, a–z, or 0–9).
isDate Determines whether a string follows a specified date pattern.
isNullEmptyOrWhitespace Determines if a string is null, empty, or only whitespace.
isNullOrBlank Checks a string for a null or a blank value.
isNumber Determines whether the contents of a string can be converted to a float value.
length Returns the length of a string.
lookupDictionary Looks up a given key in a hash table and returns the string to which that key is mapped.
lookupTable Locates a key in a String Table and returns the string to which that key is mapped.
makeString Builds a single string by concatenating the elements of a String List.
messageFormat Formats an array of strings into a given message pattern.
numericFormat Formats a number into a given numeric pattern.
objectToString Converts an object to string representation using the Java toString() method of the object.
padLeft Pads a string to a specified length by adding pad characters to the beginning of the string.
padRight Pads a string to a specified length by adding pad characters to the end of the string.
replace Replaces all occurrences of a specified substring with a substitute string.
stringToBytes Converts a string to a byte array.
substitutePipelineVariables Replaces a pipeline variable with its corresponding value.
substring Returns a substring of a given string.
tokenize Tokenizes a string using specified delimiter characters and generates a String List from the resulting tokens.
toLower Converts all characters in a given string to lowercase.
toUpper Converts all characters in a given string to uppercase.
trim Trims leading and trailing white space from a given string.
URLDecode Decodes a URL-encoded string.
URLEncode URL-encodes a string.

base64Decode

Decodes a Base-64 encoded string into a sequence of bytes.

Input Parameters

  • string: String - A Base64-encoded String to decode into bytes.

  • encoding: String Optional - Specifies the encoding method. Default value is ASCII.

Output Parameters

  • value: byte[] - The sequence of bytes decoded from the Base64-encoded String.

base64Encode

Converts a sequence of bytes into a Base64-encoded String.

Input Parameters

  • bytes: byte[] - Sequence of bytes to encode into a Base64-encoded String.

  • useNewLine: String Optional - Flag indicating whether to retain or remove the line breaks.

    Set to:

    • true to retain the line breaks. This is the default.

    • false to remove the line breaks.

  • encoding: String Optional - Specifies the encoding method. Default value is ASCII.

Output Parameters

  • value: String - Base64-encoded String encoded from the sequence of bytes.

Usage Notes

By default, the base64Encode service inserts line breaks after 76 characters of data, which is not the canonical lexical form expected by implementations such as MTOM. You can use the useNewLine parameter to remove the line breaks.

bytesToString

Converts a sequence of bytes to a String.

Input Parameters

  • bytes: byte[] - Sequence of bytes to convert to a String.

  • encoding: String Optional - Name of a registered, IANA character set (for example, ISO-8859-1). If you specify an unsupported encoding, the system throws an exception. To use the default encoding, set encoding to autoDetect.

  • ignoreBOMChars: String Optional - Flag indicating whether or not the byte order mark (BOM) characters in the input sequence of bytes are removed before converting the byte array to string.

    Set to:

    • true to remove the byte order mark (BOM) characters before converting the input sequence of bytes to string, if the byte array contains BOM characters.

    • false to include the byte order mark (BOM) characters while converting the input sequence of bytes to string. The default is false.

Output Parameters

  • string: String - String representation of the contents of bytes.

compareStrings

Performs a case-sensitive comparison of two strings and indicates whether the strings are identical.

Input Parameters

  • inString1: String Optional - String to compare against inString2. This input variable can be null.
  • inString2: String Optional - String to compare against inString1. This input variable can be null.

Output Parameters

  • isEqual: String - Indicates whether or not inString1 and inString2 are identical.

    • true indicates that inString1 and inString2 are identical.

    • false indicates that inString1 and inString2 are not identical.

Note: If both inString1 and inString2 are null, the service considers the strings to be identical and returns true.

concat

Concatenates two strings.

Input Parameters

  • inString1: String - String to which you want to concatenate another string.

  • inString2: String - String to concatenate to inString1.

Output Parameters

  • value: String - Result of concatenating inString1 with inString2 (inString1 + inString2).

fuzzyMatch

A given string is not exactly matched against a set of strings. If the match is above similarityThreshold, it returns the matchedValue. If more than one string has not exactly matched, then the first matched string is returned.

Input Parameters

  • inString: String (Required) - Text to be matched. Text should not be empty or null.

  • matchData []: String (Required) - Array of strings, which are used for matching. If the string array value is either empty or null, it is not used for matching.

  • similarityThreshold: String (Optional) - If the inexact match score is above the given threshold, then service output contains the matchedValue parameter. Default value is 0.65. Valid values should be between 0.0 and 1.0. Value 0.0 represents no match and value 1.0 represents an exact match.

  • algorithm: String (Optional) - The algorithm used for an inexact match. Default value is Levenshtein. Supported algorithms are Levenshtein and JaroWinkler.

Output Parameters

  • matchedValue: String (Optional) - If the inexact match is above similarityThreshold, then the returned value contains the matched string.

  • similarity: String (Optional) - If the inexact match is above similarityThreshold, then it contains a similarity score. It provides the measure of how close the match is. The returned value can be between 0.0 and 1.0. Value 0.0 represents no match and value 1.0 represents an exact match.

Usage Notes

Search the web for more information about Levenshtein and JaroWinkler algorithms.

HTMLDecode

Replaces HTML character entities with native characters.

Specifically, this service:

Replaces this HTML character entity... With...
&gt; >
&lt; <
&amp; &
&quot; "

Input Parameters

  • inString: String - An HTML-encoded String.

Output Parameters

  • value: String - Result from decoding the contents of inString. Any HTML character entities that existed in inString will appear as native characters in value.

HTMLEncode

Replaces HTML-sensitive characters with equivalent HTML character entities.

Specifically, this service:

Replaces this native language character... With...
> &gt;
< &lt;
& &amp;
" &quot;
&#39

These translations are useful when displaying text in an HTML context.

Input Parameters

  • inString: String - The character you want to encode in HTML.

Output Parameters

  • value: String - Result from encoding the contents of inString. Any HTML-sensitive characters that existed in inString, for example, > or &, will appear as the equivalent HTML character entities in value.

indexOf

Returns the index of the first occurrence of a sequence of characters in a string.

Input Parameters

  • inString: String - String in which you want to locate a sequence of characters.

  • subString: String - Sequence of characters to locate.

  • fromIndex: String Optional - Index of inString from which to start the search. If no value is specified, this parameter contains 0 to indicate the beginning of the string.

Output Parameters

  • value: String - Index of the first occurrence of subString in inString. If no occurrence is found, this parameter contains -1.

isAlphanumeric

Determines whether a string consists entirely of alphanumeric characters (in the ranges A–Z, a–z, or 0–9).

Input Parameters

  • inString: String Optional - String to be checked for alphanumeric characters.

Output Parameters

  • isAlphanumeric: String - Indicates whether or not all the characters in inString are alphanumeric.

    • true indicates that all the characters in inString are alphanumeric.

    • false indicates that not all the characters in inString are alphanumeric.

The service returns false if inString is not specified.

isDate

Determines whether a string follows a specified date pattern.

Input Parameters

  • inString: String Optional - String to be checked for adherence to the specified date pattern.

  • pattern: String - Date format for specifying the inString parameter (for example, yyyyMMdd HH:mm:ss.SSS). For more information about the pattern strings that can be specified for the date, see the “Pattern String Symbols” section.

Output Parameters

  • isDate: String - Indicates whether or not inString follows the specified date pattern.

    • true indicates that inString follows the specified date pattern.

    • false indicates that inString does not follow the specified date pattern.

The service returns false if inString is not specified.

Usage Notes

The service returns an error if both inString and pattern are not specified.

You can specify any random string (for example, 111212) as both inString and pattern. The service returns true if the same user-defined string is specified as both inString and pattern. This is because the java.text.SimpleDateFormat class parses the user-defined input string and pattern to a valid date when the particular input values are identical.

isNullEmptyOrWhitespace

Determines if a string is null, empty, or only whitespace.

Input Parameters

  • inString: String. Optional. String to be checked.

  • *ifPresent: Boolean. Optional.

    • If the value is set to true, the service checks whether inString is present or not, and only then proceeds with validation of the input.
    • If the value is set to false, the service throws an exception when inString is absent. Else, the service proceeds to validate the input.

Output Parameters

  • isNullEmptyOrWhitespace: String. Indicates whether inString is null, empty, or only whitespace.

    • true indicates that inString has a null value, is empty, or is only whitespace.
    • false indicates that inString is not null, not empty, or is not only whitespace.

Examples

Service with inString = " \t\n\r\n" and ifPresent = true, returns true

Service with inString=" \t\n\r\n" and ifPresent = false, returns true

Service with inString = "abcd" and ifPresent = true, returns false

Service with inString = "abcd" and ifPresent = false, returns false

Service with ifPresent = true, returns true

Service with ifPresent = false, throws an exception.

Usage Notes

string:isNullEmptyOrWhitespace replaces string:isNullOrBlank which is deprecated.

isNullOrBlank

Checks a string for a null or a blank value.

Input Parameters

  • inString: String Optional - String to be checked for a null or a blank value.

  • ifPresent: Boolean Optional - Set to one of the following values:

    • true indicates the service checks whether inString is present or not, and only then proceeds with validation of the input.
    • false indicates the service throws an exception when inString is absent. Else, the service proceeds to validate the input.

Output Parameters

  • isNullorBlank: String - Indicates whether or not inString has a null or a blank value.

    • true indicates that inString has either a null or a blank value.

    • false indicates that inString contains a value that is not null.

    If inString is not specified, the service considers the string to be blank and returns true.

isNumber

Determines whether the contents of a string can be converted to a float value.

Input Parameters

  • inString: String Optional - String to be checked for conversion to float.

Output Parameters

  • isNumber: String - Indicates whether or not inString can be converted to a float value.
    • true indicates that inString can be converted to a float value.
    • false indicates that inString cannot be converted to a float value.

The service returns false if inString is not specified.

length

Returns the length of a string.

Input Parameters

  • inString: String - String whose length you want to discover.

Output Parameters

  • value: String - The number of characters in inString.

lookupDictionary

Looks up a given key in a hash table and returns the string to which that key is mapped.

Input Parameters

  • hashtable: java.util.Hashtable - Hash table that uses String objects for keys and values.

  • key: String - Key in hashtable whose value you want to retrieve. The key is case sensitive.

Output Parameters

  • value: String - Value of the string to which key is mapped. If the requested key in hashtable is null or if key is not mapped to any value in hashtable, the service returns null.

lookupTable

Locates a key in a String Table and returns the string to which that key is mapped.

Input Parameters

  • lookupTable: String [] []. A multi-row, multi-column string table in which to search.
  • keyColumnIndex: String. Index of the "key" column. Default is 0.
  • valueColumnIndex: String. Index of the "value" column. Default is 1.
  • key: String. Key to locate.
Note: The key is case sensitive.
  • ignoreCase: String. Optional. Flag indicating whether to perform a case-sensitive or case-insensitive search.

    Set to:

    • true to perform a case-insensitive search.

    • false to perform a case-sensitive search. This is the default.

  • useRegex: String. Optional. Flag indicating whether the values in the table are to be interpreted as regular expressions.

Note: The regular expressions in the table should not include slashes. For example, use hello., not /hello.
Set to:
  • true to interpret the key column values in the table as regular expressions.
  • false to interpret the key column values in the table as literal values (that is, not regular expressions). This is the default.

Output Parameters

  • value- String First value in the "value" column whose key matches key. If no match is found, this parameter is null.

makeString

Builds a single string by concatenating the elements of a String List.

Input Parameters

  • elementList[]: String List - Strings to concatenate.

  • separator: String - String to insert between each non-null element in elementList.

Output Parameters

  • value: String - Result from concatenating the strings in elementList. Strings are separated by the characters specified in separator.

messageFormat

Formats an array of strings into a given message pattern.

Input Parameters

  • pattern: String - Message that includes "placeholders" where elements from argumentList are to be inserted. The message can contain any sequence of characters. Use the {n} placeholder to insert elements from argumentList, where n is the index of the element that you want to insert.

    For example, the following pattern string inserts elements 0 and 1 into the message: Test results: {0} items passed, {1} items failed.

Note: Do not use any characters except digits for n.
  • argumentList: String List Optional - List of strings to use to populate pattern. If argumentList is not supplied, the service will not replace placeholders in pattern with actual values.

Output Parameters

  • value: String - Result from substituting argumentList into pattern. If pattern is empty or null, this parameter is null.

numericFormat

Formats a number into a given numeric pattern.

Input Parameters

  • num: String - The number to format.

  • pattern: String - A pattern string that describes the way in which num is to be formatted:

    This symbol... Indicates...
    0 A digit.
    # A digit. Leading zeroes will not be shown.
    . A placeholder for a decimal separator.
    , A placeholder for a grouping separator.
    ; A separation in format.
    - The default negative prefix.
    % That num will be multiplied by 100 and shown as a percentage.
    X Any character used as a prefix or suffix (for example, A, $ ).
    ' That special characters are to be used as literals in a prefix or suffix. Enclose the special characters within '' (for example, '#').

    The following are examples of pattern strings:

    Pattern Description
    #,### Use commas to separate into groups of three digits. The pound sign denotes a digit and the comma is a placeholder for the grouping separator.
    #,#### Use commas to separate into groups of four digits.
    $#.00 Show digits before the decimal point as needed and exactly two digits after the decimal point. Prefix with the $ character.
    '#'#.0 Show digits before the decimal point as needed and exactly one digit after the decimal point. Prefix with the # character. The first character in a pattern is the dollar sign ($). The pound sign denotes a digit and the period is a placeholder for decimal separator.

Output Parameters

  • value: String - num formatted according to pattern. If pattern is an empty (not null) string, the default pattern of comma separators is used and the number of digits after the decimal point remains unchanged.

objectToString

Converts an object to string representation using the Java toString() method of the object.

Input Parameters

  • object: Object - The object to be converted to string representation.

Output Parameters

  • string: String - String representation of the input object converted using the Java toString() method of the object.

padLeft

Pads a string to a specified length by adding pad characters to the beginning of the string.

Input Parameters

  • inString: String - String that you want to pad.

  • padString: String - Characters to use to pad inString.

  • length: String - Total length of the resulting string, including pad characters.

Output Parameters

  • value: String - Contents of inString preceded by as many pad characters as needed so that the total length of the string equals length.

Usage Notes

If padString is longer than one character and does not fit exactly into the resulting string, the beginning of padString is aligned with the beginning of the resulting string. For example, suppose inString equals shipped and padString equals x9y.

If length equals... Then value will contain...
7 shipped
10 x9yshipped
12 x9x9yshipped

If inString is longer than length characters, only the last length characters from inString are returned. For example, if inString equals acct1234 and length equals 4, value will contain 1234.

padRight

Pads a string to a specified length by adding pad characters to the end of the string.

Input Parameters

  • inString: String - String that you want to pad.

  • padString: String - Characters to use to pad inString.

  • length: String - Total length of the resulting string, including pad characters.

Output Parameters

  • value: String - Contents of inString followed by as many pad characters as needed so that the total length of the string equals length.

Usage Notes

If padString is longer than one character and does not fit exactly into the resulting string, the end of padString is aligned with the end of the resulting string. For example, suppose inString equals shipped and padString equals x9y.

If length equals... Then value will contain...
7 shipped
10 shippedx9y
12 shippedx9y9y

If inString is longer than length characters, only the first length characters from inString are returned. For example, if inString equals 1234acct and length equals 4, value will contain 1234.

replace

Replaces all occurrences of a specified substring with a substitute string.

Input Parameters

  • inString: String - String containing the substring to replace.

  • searchString: String - Substring to replace within inString.

  • replaceString: String - Character sequence that will replace searchString. If this parameter is null or empty, the service removes all occurrences of searchString from inString.

  • useRegex: String Optional - Flag indicating whether searchString is a regular expression. When regular expressions are used to specify a search string, replaceString may also contain interpolation fields (for example, "$1") that match parenthetical subexpressions in searchString.

    Set to:

    • true - To indicate that searchString is a regular expression.

    • false - To indicate that searchString is not a regular expression. This is the default.

Output Parameters

  • value: String - Contents of inString with replacements made.

stringToBytes

Converts a string to a byte array.

Input Parameters

  • string: String - String to convert to a byte[].

  • encoding: String Optional - Name of a registered, IANA character set that specifies the encoding to use when converting the String to an array of bytes (for example: ISO-8859-1). To use the default encoding, set this value to autoDetect. If you specify an unsupported encoding, an exception will be thrown.

Output Parameters

  • bytes: byte[] - Contents of string represented as a byte[].

substitutePipelineVariables

Replaces a pipeline variable with its corresponding value.

Input Parameters

  • inString: String Optional - String containing the pipeline variable to replace. Specify the name of the pipeline variable between the % symbols (for example, %phone%).

Output Parameters

  • value: String - Contents of inString with the pipeline variable replaced.

Usage Notes

The service returns an error if inString is not specified.

If inString does not contain any variable between the % symbols, or contains a value other than the pipeline variable between the % symbols, the service does not perform any variable substitution from the pipeline.

If you want to include the % symbol in the output, you can specify it as \% in inString. To specify the value of the pipeline variable as a percentage in the output, append \% after the variable name in inString. For example, suppose a pipeline variable revenueIncreasePercent has a value of 100.

If inString equals... Then value will contain...
%revenueIncreasePercent%\% 100%

The service cannot be used for substitution of global variables.

substring

Returns a substring of a given string.

Input Parameters

  • inString: String - String from which to extract a substring.

  • beginIndex: String - Beginning index of the substring to extract (inclusive).

  • endIndex: String - Ending index of the substring to extract (exclusive). If this parameter is null or empty, the substring will extend to the end of inString.

Output Parameters

  • value: String - Substring from beginIndex and extending to the character at endIndex - 1.

tokenize

Tokenizes a string using specified delimiter characters and generates a String List from the resulting tokens.

This service does not return delimiters as tokens.

Input Parameters

  • inString: String - String you want to tokenize, that is, break into delimited chunks.

  • delim: String - Delimiter characters. If null or empty, the service uses the default delimiters \t\n\r, where t, n, and r represent the white space characters tab, new line, and carriage return.

  • useRegex: Boolean Optional - If the value is set to true, IBM webMethods Integration supports recognizing the delimiter character set for the delim parameter as a regular expression. If the value is set to false, IBM webMethods Integration considers the delimiter character set for the delim parameter as an individual character. This is the default.

Output Parameters

  • valueList []: String List - Strings containing the tokens extracted from inString.

toLower

Converts all characters in a given string to lowercase.

Input Parameters

  • inString: String - String to convert.

  • language: String Optional - Lowercase, two-letter ISO-639 code. If this parameter is null, the system default is used.

  • country: String Optional - Uppercase, two-letter ISO-3166 code. If this parameter is null, the system default is used.

  • variant: String Optional - Vendor and browser-specific code. If null, this parameter is ignored.

Output Parameters

  • value: String - Contents of inString, with all uppercase characters converted to lowercase.

toUpper

Converts all characters in a given string to uppercase.

Input Parameters

  • inString: String - String to convert.

  • language: String Optional - Lowercase, two-letter ISO-639 code. If this parameter is null, the system default is used.

  • country: String Optional - Uppercase, two-letter ISO-3166 code. If this parameter is null, the system default is used.

  • variant: String Optional - Vendor and browser-specific code. If null, this parameter is ignored.

Output Parameters

  • value: String - Contents of inString, with all lowercase characters converted to uppercase.

trim

Trims leading and trailing white space from a given string.

Input Parameters

  • inString: String - String to trim.

Output Parameters

  • value: String - Contents of inString with white space trimmed from both ends.

URLDecode

Decodes a URL-encoded string.

Input Parameters

  • inString: String URL-encoded string to decode.

Output Parameters

  • value: String - Result from decoding inString. If inString contains plus (+) signs, they will appear in value as spaces. If inString contains %hex encoded characters, they will appear in value as the appropriate native character.

URLEncode

URL-encodes a string.

Encodes characters the same way that data posted from a WWW form is encoded, that is, the application/x-www-form-urlencoded MIME type.

Input Parameters

  • inString: String - String to URL-encode.

Output Parameters

  • value: String - Result from URL-encoding inString. If inString contains non-alphanumeric characters (except [-_.*@]), they will appear in value as their URL-encoded equivalents (% followed by a two-digit hex code). If inString contains spaces, they will appear in value as plus (+) signs.

Transaction Services

Use Transaction services only in conjunction with Database Connector operations. These services are applicable when the Database Connector account is of type Transactional.

The following Transaction services are available:

Service Description
commit Commits an explicit transaction.
rollback Rolls back an explicit transaction.
setTimeout Manually sets a transaction timeout interval for implicit and explicit transactions.
start Starts an explicit transaction.

commit

Commits an explicit transaction.

Input Parameters

  • commitTransactionInput: Document - Information for each commit request.
    • transactionName: String - The name of an explicit transaction that you want to commit. The transactionName must have been previously used in a call to Transaction:start. This value must be mapped from the most recent Transaction:start that has not previously been committed or rolled back.

Output Parameters

None.

Usage Notes

This service must be used in conjunction with the Transaction:start service. If the transactionName parameter was not provided in a prior call to Transaction:start, a run-time error will be returned.

rollback

Rolls back an explicit transaction.

Input Parameters

  • rollbackTransactionInput: Document List - Information for each rollback request.
    • transactionName: String - The name of an explicit transaction that you want to roll back. The transactionName must have been previously used in a call to Transaction:start. This value must be mapped from the most recent Transaction:start that has not previously been committed or rolled back.

Output Parameters

None.

Usage Notes

This service must be used in conjunction with the Transaction:start service. If the given transactionName parameter was not provided in a prior call to Transaction:start, a run-time error will be returned.

setTimeout

Manually sets a transaction timeout interval for implicit and explicit transactions.

Input Parameters

  • timeoutSeconds: Integer - The number of seconds that the implicit or explicit transaction stays open before the transaction manager marks it for rollback.

Output Parameters

None.

Usage Notes

You must call this service before you call the Transaction:start service. If the execution of a transaction takes longer than the transaction timeout interval, all transacted operations are rolled back.

start

Starts an explicit transaction.

Input Parameters

  • startTransactionInput: Document - Information for each start transaction request.
    • transactionName: String Optional - Specifies the name of the transaction to be started. If you leave this parameter blank, the Database Application will generate a name for you. In most implementations it is not necessary to provide your own transaction name.

Output Parameters

  • startTransactionOutput: Document - Information for each start transaction request.
    • transactionName: String - The name of the transaction the service just started.

Usage Notes

This service is intended for use with the Transaction:commit or Transaction:rollback service. The transactionName value returned by a call to this service can be provided to Transaction:commit (to commit the transaction) or Transaction:rollback (to roll back the transaction).

Utils Services

Contains utility services.

The following Utils services are available:

Service Description
generateUUID Generates a random Universally Unique Identifier (UUID).
createMessageDigest Generates a message digest for a given message.
deepClone Clones an object using the default Java serialization mechanism.
transcode Transcodes data from one encoding to another.

generateUUID

Generates a random Universally Unique Identifier (UUID).

Input Parameters

None

Output Parameters

  • UUID: String - A randomly generated Universally Unique Identifier (UUID).

createMessageDigest

Generates a message digest for a given message.

Input Parameters

  • algorithm: String. Name of the algorithm that you want to use to compute the message digest. Must be one of the following: MD5, SHA-1, SHA-256, SHA-384, or SHA-512.

  • input: byte[]. Optional. Message for which you want the digest generated where the message is in the form of a byte array. If both input and inputAsStream are provided, inputAsStream takes precedence.

  • inputAsStream: java.io.InputStream. Optional. Message for which you want to generate a message digest where the message is in the form of an input stream. If both input and inputAsStream are provided, inputAsStream takes precedence.

Output Parameters

  • output: byte[]. Conditional. Computed digest in the form of a byte array. output is returned when the input parameter input is provided.

  • outputAsStream: OutputStream. Conditional. Computed digest in the form of an output stream. outputAsStream is returned when the input parameter inputAsStream is provided.

deepClone

Clones an object using the default Java serialization mechanism.

Input Parameters

  • originalObject: java.io.Serializable. Object to be cloned.

Output Parameters

  • clonedObject: Object. Copy of the originalObject.

transcode

Transcodes data from one encoding to another.

Input Parameters

  • inputData: Document. Data to be transcoded. Depending on the data type of the source data, use string or bytes variable to specify the data. You must provide input data to string or bytes. If you do not specify input data in either string or bytes, the utils:transcode service ends with an exception. If you specify input data for both string and bytes, the utils:transcode service uses the contents of string, ignoring bytes.

    Key Description
    string String. Optional. String containing the data to convert to another encoding.
    bytes byte[]. Optional. Sequence of bytes to convert to another encoding.
  • sourceEncoding: String. Encoding used for the source data. This must be an encoding supported by the JRE used with IBM webMethods Integration.

  • targetEncoding: String. Encoding to which the source data needs to be transcoded. This must be an encoding supported by the JRE used with IBM webMethods Integration.

  • onTranscoding Error: String. Optional. Specifies the action to take when encountering unmappable characters. When transcoding data from one character set to annother, it is possible that a character in the source encoding cannot be mapped to a character in the target encoding. Specify one of the following:

    • replace to replace an unmappable character with a replacement character. If you select replace, specify a replacement character in replaceWith.

    • ignore to drop any unmappable characters.

    • report to throw a ServiceException if the service encounters any unmappable characters. This is the default.

  • replaceWith: Document. Optional. Character used to replace an unmappable character found during transcoding. Specify a replacement character for characters that cannot be mapped in string or bytes.

    The utils:transcode service uses a replacement character only when onTranscodingError is set to replace.

    If onTranscodingError is set to replace and a replacement character is not specified, the utils:transcode service uses the default replacement character of space (“\u0020”).

    If you specify a replacement character for both string and bytes, the utils:transcode service uses the contents of string, ignoring bytes.

    Key Description
    string String. Optional. The replacement character to use for unmappable characters in the input data.
    bytes byte[]. Optional. The replacement character to use for unmappable characters in the input data.
  • outputAs: String. Optional. The data type to use for the output data. Specify one of the following:

    • string

    • bytes

    If you do not specify a value for outputAs, the utils:transcode service returns the output in the same data type used for inputData. For example, if you supplied the source data to inputData/string, the service returns the target data to the outputData/string output parameter.

  • normalizationForm: String. Optional. The Unicode normalization form to use during transcoding.

    Specify one of the following:

    • none: Indicates that normalization is not done.

    • NFC (Normalization Form C): Canonical Decomposition, followed by Canonical Composition. This is the default.

    • NFD (Normalization Form D). Canonical Decomposition.

    • NFKC (Normalization Form KC). Compatibility Decomposition, followed by Canonical Composition

    • NFKD (Normalization Form KD) Compatibility Decomposition.

Output Parameters

  • outputData: Document Transcoded data. The utils.:transcode service returns the transcoded data in outputData/string or outputData/bytes, depending on the value of the outputAs input parameter. If a value was not specified for outputAs, the service returns the transcoded data in the same data type as the supplied input data.
Key Description
string String. Conditional. Transcoded contents of inputData as a String. The utils:transcode service string returns this output parameter if the input data was supplied in inputData/string or outputAs was set to string.
bytes byte[]. Conditional. Transcoded contents of inputData as a byte[]. The utils:transcode service bytes returns this output parameter if the input data was supplied in inputData/bytes or outputAs was set to bytes.

XML Services

Use XML services to convert a document to XML content and XML content to a document.

The following XML services are available:

Service Description
documentToXMLBytes Converts a document to XML content bytes, as a byte array object.
documentToXMLStream Converts a document to XML stream, as a java.io.InputStream object.
documentToXMLString Converts a document to XML content string.
getXMLNodeType Returns information about an XML node.
queryXMLNode Queries an XML node.
xmlBytesToDocument Converts XML content bytes (byte array) to a document.
xmlNodeToDocument Converts an XML node to a document.
xmlStreamToDocument Converts an XML content stream to a document.
xmlStringToDocument Converts an XML string to a document.
xmlStringToXMLNode Converts a String, byte[], or InputStream containing an XML document to an XML node.
getXMLNodeIterator Creates and retrieves a NodeIterator.
getNextXMLNode Retrieves the next XML node from a NodeIterator.
freeXMLNode Frees the resources allocated to a given XML node.

documentToXMLBytes

Converts a document to XML content bytes, as a byte array object. This service will recurse through a given document and build an XML representation from the elements within it. Key names are turned into XML elements, and the key values are turned into the contents of those elements.

Input Parameters

  • document: Document - Document that is to be converted to XML. Note that if you want to produce a valid XML document (one with a single root node), document must contain only one top-level document that is, a single document. The name of that document will serve as the name of the XML document's root element. If you need to produce an XML fragment, for example, a loose collection of elements that are not encompassed within a single root element, then document can contain multiple top level elements.

  • nsDecls []: Document Optional - Namespaces associated with any namespace prefixes that are used in the key names in document. Each entry in nsDecls represents a namespace prefix/URI pair, where a key name represents a prefix and the value of the key specifies the namespace URI.

  • addHeader: String Optional - Flag specifying whether the header element <?xml version="1.0"?> is to be included in the resulting XML String.

    Set to:

    • true to include the header. This is the default.
    • false to omit the header. Omit the header to generate an XML fragment or to insert a custom header.
  • attrPrefix: String Optional - Prefix that designates keys containing attributes. The default prefix is "@".
  • encode: String Optional - Flag indicating whether to HTML-encode the data. Set this parameter to true if your XML data contains special characters, including the following: < > & " '

    Set to:

    • true to HTML-encode the data. For example, the string expression 5 < 6 would be converted to <expr>5 &lt; 6</expr>, which is valid. If you do not want a leading & (ampersand) character encoded when it appears as part of a character or entity reference, set preserveRefs to true.
    • false to To not HTML-encode the data. This is the default. For example, the string expression 5 < 6 would be converted to <expr>5 < 6</expr>, which is invalid.

  • strictEncodeElements: String. Optional. Controls the behavior of the encode parameter. If this parameter is set to true when the encode parameter is true, then only the strictEncodeElements < > & characters in the element content are HTML-encoded (the apostrophe and quote characters are not HTML-encoded).

    Default value is false.

  • preserveRefs: String Optional - Flag indicating whether the leading & (ampersand) of a well-formed entity or character reference is left as & or further encoded as &amp; when the data is to be HTML-encoded (encode is set to true).

    Set to:

    • true to preserve the leading & (ampersand) in an entity or character reference when the service HTML-encodes the data.
    • false to To encode the leading & (ampersand) as &amp; when the & appears in an entity or character reference. This is the default. The service ignores the value of preserveRefs when encode is set to false.
  • documentTypeName: String (picklist). Optional. Document type that describes the structure and format of the output document. You can use this parameter to ensure that the output includes elements that might not be present in document at run time, or to describe the order in which elements are to appear in the resulting XML String. If you are using derived type processing, you must provide this parameter.

  • generateRequiredTags: String. Optional. Flag indicating whether empty tags are to be included in the output document if a mandatory element appears in the document generateRequiredTags type specified in documentTypeName but does not appear in document. Set to:

    • true to include mandatory elements if they are not present in document.
    • false to omit mandatory elements if they are not present in document.

    Default value is false.

    Note: The generateRequiredTags is only applicable if documentTypeName is provided.
  • generateNilTags: String. Optional. Flag indicating whether the resulting XML string includes the attribute xsi:nil for elements that are null. Set to:

    • true to generate the xsi:nil attribute for an element if the Allow null property for the corresponding field is set to true and the field is null in document.
    Note: generateRequiredTags must also be set to true to generate the xsi:nil attribute in the XML String.
    • false to omit the xsi:nil attribute even if a nillable field is, in fact, null.

    Default value is false.

  • enforceLegalXML: String Optional - Flag indicating whether the service throws an exception when document contains multiple root elements or illegal XML tag names.

    Set to:

    • true to throw an exception if document would produce an XML String containing multiple root elements and/or illegal XML tag names.

    • false to allow the resulting XML String to contain multiple root elements and/or illegal XML tag names. You would use this setting, for example, to create an XML fragment composed of multiple elements that were not all enclosed within a root element. This is the default.

  • dtdHeaderInfo: String. Optional. Contents of the DOCTYPE header to be inserted into the XML String.

Key Description
systemID String Optional. System identifier for the DTD, if any.
publicID String Optional. Public identifier for the DTD, if any.
rootNSPrefix String Optional. Namespace prefix of the rootLocalName, if any.
rootLocalName String Optional. Local name (excluding the namespace prefix) of the root element.
  • bufferSize: String. Optional. Initial size (in bytes) of the String buffer that documentToXMLString uses to assemble the output XML String. If the String bufferSize buffer fills up before documentToXMLString is finished generating the XML String, it reallocates the buffer, expanding it by this amount each time the buffer becomes full.

Output Parameters

  • xmlBytes: Object. XML content bytes (byte array) produced from document. To include namespaces, ensure that you do the following:

    • Include the appropriate namespace prefix in the key names in document. For example, to produce an element called acctNum that belongs to a namespace that is represented by the "GSX" prefix, you would include a key named GSX:acctNum in document.
    • Define the URIs for the prefixes that appear in document. You can do this through nsDecls or by including an @xmlns key in the element where you want the xmlns attribute to be inserted.

documentToXMLStream

Converts a document to xml stream, as a java.io.InputStream object. This service will recurse through a given document and build an XML representation from the elements within it. Key names are turned into XML elements and the key values are turned into contents of those elements.

Input Parameters

  • document: Document - Document that is to be converted to XML. Note that if you want to produce a valid XML document (one with a single root node), document must contain only one top-level document that is, a single document. The name of that document will serve as the name of the XML document's root element. If you need to produce an XML fragment, for example, a loose collection of elements that are not encompassed within a single root element, then document can contain multiple top level elements.

  • nsDecls []: Document Optional - Namespaces associated with any namespace prefixes that are used in the key names in document. Each entry in nsDecls represents a namespace prefix/URI pair, where a key name represents a prefix and the value of the key specifies the namespace URI.
  • addHeader: String Optional - Flag specifying whether the header element <?xml version="1.0"?> is to be included in the resulting XML String.

    Set to:

    • true to include the header. This is the default.
    • false to omit the header. Omit the header to generate an XML fragment or to insert a custom header.

  • attrPrefix: String Optional - Prefix that designates keys containing attributes. The default prefix is "@".

  • encode: String Optional - Flag indicating whether to HTML-encode the data. Set this parameter to true if your XML data contains special characters, including the following: < > & " '

    Set to:

    • true to HTML-encode the data. For example, the string expression 5 < 6 would be converted to <expr>5 &lt; 6</expr>, which is valid. If you do not want a leading & (ampersand) character encoded when it appears as part of a character or entity reference, set preserveRefs to true.

    • false to not HTML-encode the data. This is the default. For example, the string expression 5 < 6 would be converted to <expr>5 < 6</expr>, which is invalid.

  • strictEncodeElements: String. Optional. Controls the behavior of the encode parameter. If this parameter is set to true when the encode parameter is true, then only the strictEncodeElements < > & characters in the element content are HTML-encoded (the apostrophe and quote characters are not HTML-encoded).

    Default value is false.

  • preserveRefs: String Optional - Flag indicating whether the leading & (ampersand) of a well-formed entity or character reference is left as & or further encoded as &amp; when the data is to be HTML-encoded (encode is set to true).

    Set to:

    • true to preserve the leading & (ampersand) in an entity or character reference when the service HTML-encodes the data.

    • false to encode the leading & (ampersand) as &amp; when the & appears in an entity or character reference. This is the default. The service ignores the value of preserveRefs when encode is set to false.

  • documentTypeName: String (picklist). Optional. Document type that describes the structure and format of the output document. You can use this parameter to ensure that the output includes elements that might not be present in document at run time, or to describe the order in which elements are to appear in the resulting XML String. If you are using derived type processing, you must provide this parameter.

  • generateRequiredTags: String. Optional. Flag indicating whether empty tags are to be included in the output document if a mandatory element appears in the document generateRequiredTags type specified in documentTypeName but does not appear in document. Set to:

    • true to include mandatory elements if they are not present in document.

    • false to omit mandatory elements if they are not present in document.

    Default value is false.

    Note: The generateRequiredTags is only applicable if documentTypeName is provided.
  • generateNilTags: String. Optional. Flag indicating whether the resulting XML string includes the attribute xsi:nil for elements that are null. Set to:

    • true to generate the xsi:nil attribute for an element if the Allow null property for the corresponding field is set to true and the field is null in document.
    Note: generateRequiredTags must also be set to true to generate the xsi:nil attribute in the XML String.
    • false to omit the xsi:nil attribute even if a nillable field is, in fact, null.

    Default value is false.

  • enforceLegalXML: String Optional - Flag indicating whether the service throws an exception when document contains multiple root elements or illegal XML tag names.

    Set to:

    • true to throw an exception if document would produce an XML String containing multiple root elements and/or illegal XML tag names.

    • false to allow the resulting XML String to contain multiple root elements and/or illegal XML tag names. You would use this setting, for example, to create an XML fragment composed of multiple elements that were not all enclosed within a root element. This is the default.

  • dtdHeaderInfo: String. Optional. Contents of the DOCTYPE header to be inserted into the XML String.

Key Description
systemID String Optional. System identifier for the DTD, if any.
publicID String Optional. Public identifier for the DTD, if any.
rootNSPrefix String Optional. Namespace prefix of the rootLocalName, if any.
rootLocalName String Optional. Local name (excluding the namespace prefix) of the root element.
  • bufferSize: String. Optional. Initial size (in bytes) of the String buffer that documentToXMLString uses to assemble the output XML String. If the String bufferSize buffer fills up before documentToXMLString is finished generating the XML String, it reallocates the buffer, expanding it by this amount each time the buffer becomes full.

Output Parameters

  • xmlStream: java.io.InputStream - XML content stream produced from document. To include namespaces, ensure that you do the following:

    • Include the appropriate namespace prefix in the key names in document. For example, to produce an element called acctNum that belongs to a namespace that is represented by the "GSX" prefix, you would include a key named GSX:acctNum in document.

    • Define the URIs for the prefixes that appear in document. You can do this through nsDecls or by including an @xmlns key in the element where you want the xmlns attribute to be inserted.

documentToXMLString

Converts a document to xml content string. This service will recurse through a given document and build an XML representation from the elements within it. Key names are turned into XML elements, and the key values are turned into the contents of those elements.

Input Parameters

  • document: Document - Document that is to be converted to XML. If you want to produce a valid XML document (one with a single root node), document must contain only one top-level document that is, a single document. The name of that document will serve as the name of the XML document's root element. If you need to produce an XML fragment, for example, a loose collection of elements that are not encompassed within a single root element, then document can contain multiple top level elements.

  • nsDecls []: Document Optional - Namespaces associated with any namespace prefixes that are used in the key names in document. Each entry in nsDecls represents a namespace prefix/URI pair, where a key name represents a prefix and the value of the key specifies the namespace URI.

  • addHeader: String Optional - Flag specifying whether the header element <?xml version="1.0"?> is to be included in the resulting XML String.

    Set to:

    • true to include the header. This is the default.

    • false to omit the header. Omit the header to generate an XML fragment or to insert a custom header.

  • attrPrefix: String Optional - Prefix that designates keys containing attributes. The default prefix is "@".

  • encode: String Optional - Flag indicating whether to HTML-encode the data. Set this parameter to true if your XML data contains special characters, including the following: < > & " '

    Set to:

    • true to HTML-encode the data. For example, the string expression 5 < 6 would be converted to <expr>5 &lt; 6</expr>, which is valid. If you do not want a leading & (ampersand) character encoded when it appears as part of a character or entity reference, set preserveRefs to true.

    • false to not HTML-encode the data. This is the default. For example, the string expression 5 < 6 would be converted to <expr>5 < 6</expr>, which is invalid.

  • strictEncodeElements: String. Optional. Controls the behavior of the encode parameter. If this parameter is set to true when the encode parameter is true, then only the strictEncodeElements < > & characters in the element content are HTML-encoded (the apostrophe and quote characters are not HTML-encoded).

    Default value is false.

  • preserveRefs: String Optional - Flag indicating whether the leading & (ampersand) of a well-formed entity or character reference is left as & or further encoded as &amp; when the data is to be HTML-encoded (encode is set to true).

    Set to:

    • true to preserve the leading & (ampersand) in an entity or character reference when the service HTML-encodes the data.

    • false to encode the leading & (ampersand) as &amp; when the & appears in an entity or character reference. This is the default. The service ignores the value of preserveRefs when encode is set to false.

  • documentTypeName: String (picklist). Optional. Document type that describes the structure and format of the output document. You can use this parameter to ensure that the output includes elements that might not be present in document at run time, or to describe the order in which elements are to appear in the resulting XML String. If you are using derived type processing, you must provide this parameter.

  • generateRequiredTags: String. Optional. Flag indicating whether empty tags are to be included in the output document if a mandatory element appears in the document generateRequiredTags type specified in documentTypeName but does not appear in document. Set to:

    • true to include mandatory elements if they are not present in document.

    • false to omit mandatory elements if they are not present in document.

    Default value is false.

    Note: The generateRequiredTags is only applicable if documentTypeName is provided.
  • generateNilTags: String. Optional. Flag indicating whether the resulting XML string includes the attribute xsi:nil for elements that are null. Set to:

    • true to generate the xsi:nil attribute for an element if the Allow null property for the corresponding field is set to true and the field is null in document.
    Note: generateRequiredTags must also be set to true to generate the xsi:nil attribute in the XML String.
    • false to omit the xsi:nil attribute even if a nillable field is, in fact, null.

    Default value is false.

  • enforceLegalXML: String Optional - Flag indicating whether the service throws an exception when document contains multiple root elements or illegal XML tag names.

    Set to:

    • true to throw an exception if document would produce an XML String containing multiple root elements and/or illegal XML tag names.

    • false to allow the resulting XML String to contain multiple root elements and/or illegal XML tag names. You would use this setting, for example, to create an XML fragment composed of multiple elements that were not all enclosed within a root element. This is the default.

  • dtdHeaderInfo: String. Optional. Contents of the DOCTYPE header to be inserted into the XML String.

Key Description
systemID String Optional. System identifier for the DTD, if any.
publicID String Optional. Public identifier for the DTD, if any.
rootNSPrefix String Optional. Namespace prefix of the rootLocalName, if any.
rootLocalName String Optional. Local name (excluding the namespace prefix) of the root element.
  • bufferSize: String. Optional. Initial size (in bytes) of the String buffer that documentToXMLString uses to assemble the output XML String. If the String bufferSize buffer fills up before documentToXMLString is finished generating the XML String, it reallocates the buffer, expanding it by this amount each time the buffer becomes full.

Output Parameters

  • xmlString: Object - XML document string produced from document. To include namespaces, ensure that you do the following:

    • Include the appropriate namespace prefix in the key names in document. For example, to produce an element called acctNum that belongs to a namespace that is represented by the "GSX" prefix, you would include a key named GSX:acctNum in the document.
    • Define the URIs for the prefixes that appear in document. You can do this through nsDecls or by including an @xmlns key in the element where you want the xmlns attribute to be inserted.

getXMLNodeType

Returns information about an XML node.

Input Parameters

  • rootNode: com.wm.lang.xml.Document - XML node about which you want information.

Output Parameters

  • systemID: String Conditional - System identifier, as provided by the DTD associated with rootNode. If rootNode does not have a system identifier, this value is null.

  • publicID: String Conditional - Public identifier, as provided by the DTD associated with rootNode. If rootNode does not have a public identifier, this value is null.

  • rootNamespace: String - URI of the XML namespace to which rootNode's root element belongs.

  • rootNSPrefix: String Conditional - Namespace prefix of root element in rootNode, if any.

  • rootLocalName: String Conditional - Local name (excluding the namespace prefix) of the root element in rootNode, if any.

queryXMLNode

Queries an XML node.

The fields parameter specifies how data is extracted from the node to produce an output variable. This output variable is called a "binding," because the fields parameter binds a certain part of the document to a particular output variable. At run time, this service must include at least one fields entry. The service must include at least one entry in fields. The result of each query you specify in fields is returned in a variable whose name and type you specify.

Input Parameters

  • node: The XML node that you want to query. This parameter supports the following types of input:

    • com.wm.lang.xml.Node - XML node that you want to query. An XML node can be produced by xmlStringToXMLNode or an XML content handler.
  • nsDecls: Document Optional - Namespaces associated with any namespace prefixes used element to specify elements in fields/query. Each entry in nsDecls represents a namespace prefix/URI pair, where a key name represents a prefix and the value of the key specifies the namespace URI.

  • fields: Document List Optional - Parameters describing how data is to be extracted from node. Each document in the list contains parameters for a single query, as follows:

    • name: String: Name to assign to resulting value.
    • resultType: String - Object type that the query is to yield. The following shows the allowed underlying value and the corresponding data type for resultType.

      Object: ObjectObject[]

      Object ListRecord

      - DocumentRecord[]

      - Document List

      - String - StringString[]

      - String ListString[]

      String Table

    • query: String - Query identifying the data to be extracted from node.
    • queryType: String - Query language in which query is expressed. Valid values are WQL and XQL.
    • onnull: String - Code indicating what you want queryXMLNode to do when the result is null. Set to one of the following:

      - continue - To indicate that all result values are acceptable for this query (including null).

      fail - To indicate that the service should fail if the result of this query is null and continue in all other cases.

      fail - To indicate that the service should fail if the result of this query is null and continue in all other cases.

      fail - To indicate that the service should fail if the result of this query is null and continue in all other cases.

      succeed - To indicate that the service should continue if the result of this query is null and fail in all other cases.

    • fields []: Document List - Parameters that support recursive execution of bindings. Each fields list defines bindings for one level of the output with the top level being the pipeline and the first level down being contents of a document or document list in the pipeline.

Output Parameters

  • Document: Results from the queries specified in fields. This service returns one element for each query specified in fields. The specific names and types of the returned elements are determined by the fields/name and field/resultType parameters of the individual queries.

Usage Notes

If queryXMLNode fails, it throws an exception. Common reasons for queryXMLNode to fail include:

  • A variable that has no query string assigned to it.

  • A syntax error in a query string.

  • A query fails the “Allows Null” test.

  • The node variable does not exist or it is null.

xmlBytesToDocument

Converts XML content bytes (byte array) to a document. This service transforms each element and attribute in XML content bytes to an element in a Document.

Input Parameters

  • xmlBytes: Object - XML content bytes that is to be converted to a document.

  • nsDecls: Document Optional - Namespace prefixes to use for the conversion. This parameter specifies the prefixes that will be used when namespace-qualified elements are converted to key names in the resulting Document. For example, if you want elements belonging to a particular namespace to have the prefix GSX in the resulting Document (for example, GSX:acctNum), you would associate the prefix GSX with that namespace in nsDecls. This is important because incoming XML documents can use any prefix for a given namespace, but the key names expected by a target service will have a fixed prefix. Namespace prefixes in nsDecls also define the prefixes used by the arrays, documents, and collect parameters. Each entry in nsDecls represents a namespace prefix/URI pair, where a key name represents a prefix and the value of the key specifies the namespace URI.

  • preserveUndeclaredNS: String Optional - Flag indicating whether or not IBM webMethods Integration keeps undeclared namespaces in the resulting document. An undeclared namespace is one that is not specified as part of the nsDecls input parameter.

    Set to:

    • true to preserve undeclared namespaces in the resulting document. For each namespace declaration in the XML document that is not specified in the nsDecls parameter, IBM webMethods Integration adds the xmlns attribute as a String variable to the document. IBM webMethods Integration gives the variable a name that begins with "@xmlns" and assigns the variable the namespace value specified in the XML document. IBM webMethods Integration preserves the position of the undeclared namespace in the resulting document.

    • falseto ignore namespace declarations in the XML document that are not specified in the nsDecls parameter. This is the default.

  • preserveNSPositions: String Optional - Flag indicating whether or not IBM webMethods Integration maintains the position of namespaces declared in the nsDecls parameter in the resulting document.

    Set to:

    • true to preserve the position of namespaces declared in nsDecls in the resulting document. For each namespace specified in the nsDecls parameter, IBM webMethods Integration adds the xmlns attribute to the document (IData) as a String variable named "@xmlns:NSprefix" where "NSprefix" is the prefix name specified in nsDecls. IBM webMethods Integration assigns the variable the namespace value specified in the XML document. This variable maintains the position of the xmlns attribute declaration within the XML document.

    • falseto not maintain the position of the namespace declarations specified in nsDecls in the resulting document. This is the default.

Output Parameters

  • document: Document - Document representation of nodes and attributes in node.

xmlNodeToDocument

Converts an XML node to a document.

This service transforms each element and attribute in the XML node to an element in a Document.

Notes:

  • The XML version attribute is converted to an element named @version .
  • The resulting document is given the same name as the XML document's root element and is a child of the document variable that this service returns.
  • Simple elements are converted to String elements.
  • Complex elements and simple elements that have attributes are converted to documents. Note that keys derived from attributes are prefixed with a "@" character to distinguish them from keys derived from elements. Also note that when a simple element has an attribute, its value is placed in an element named *body.
  • Repeated elements can be collected into arrays using the makeArrays and/or arrays parameters. See makeArrays and arrays below for additional information about producing arrays.
  • While creating a document, the xmlNodeToDocument service assigns a value of emptyString to the fields that are empty in the document.

Input Parameters

  • node: XML node that is to be converted to a document. This parameter supports the com.wm.lang.xml.Node and org.w3c.dom.Node types of input.

  • attrPrefix: String Optional - Prefix that is to be used to designate keys containing attribute values. The default is "@".

  • arrays []: String List Optional - Names of elements that are to be generated as arrays, regardless of whether they appear multiple times in node. For example, if arrays contained rep and address for an XML document, xmlNodeToDocument would generate element rep as a String List and element address as a Document List. If you include namespace prefixes in the element names that you specify in arrays, you must define the namespaces associated with those prefixes in nsDecls.

  • makeArrays: String Optional - Flag indicating whether you want xmlNodeToDocument to automatically create an array for every element that appears in node more than once.

    Set to:

    • true to automatically create arrays for every element that appears more than once in node. This is the default.

    • falseto create arrays for only those elements specified in arrays.

  • collect: Document Optional - Elements that are to be placed into a new, named array (that is, a "collection"). Within collect, use key names to specify the names of the elements that are to be included in the collection. Then set the value of each key to specify the name of the collection in which you want that element placed. For example, if you want to place the name and rep elements in an array called originator, you would set collect as follows:

    • Key: name
    • Value: originator
    • Key: rep
    • Value: originator

    If the set of elements in a collection are all simple elements, a String List is produced. However, if the set is made up of complex elements, or a combination of simple and complex elements, a Document List is produced. When this is the case, each member of the array will include a child element called *name that contains the name of the element from which that member was derived. You may optionally include namespace prefixes in the element names that you specify in collect; however, if you do, you must define the namespaces associated with those prefixes in nsDecls. You cannot include an element in more than one collection.

  • nsDecls: Document Optional - Namespace prefixes to use for the conversion. This parameter specifies the prefixes that will be used when namespace-qualified elements are converted to key names in the resulting Document. For example, if you want elements belonging to a particular namespace to have the prefix GSX in the resulting Document (for example, GSX:acctNum), you would associate the prefix GSX with that namespace in nsDecls. This is important because incoming XML documents can use any prefix for a given namespace, but the key names expected by a target service will have a fixed prefix. Namespace prefixes in nsDecls also define the prefixes used by the arrays, documents, and collect parameters. Each entry in nsDecls represents a namespace prefix/URI pair, where a key name represents a prefix and the value of the key specifies the namespace URI.

  • documents[]: String List Optional - Names of any simple elements that are to be generated as documents instead of Strings. The document produced for each element specified in documents[] will have the same name as the source element from which it is derived. It will contain a String element named *body that holds the element's value. If you include namespace prefixes in the element names that you specify, you must define the namespaces associated with those prefixes in nsDecls.

  • documentTypeName: String (picklist). Optional. Document type that describes the structure and format of the output document. You can use this parameter to ensure that the output includes elements that might not be present in document at run time, or to describe the order in which elements are to appear in the resulting XML String. If you are using derived type processing, you must provide this parameter.

  • mixedModel: String Optional - Flag specifying how mixed-content elements (elements containing both text values and child elements) are to be converted.

    Set to:

    • true to place top-level text in an element named *body.

    • falseto omit top-level text and include only the child elements from mixed-content elements.

  • preserveUndeclaredNS: String Optional - Flag indicating whether or not IBM webMethods Integration keeps undeclared namespaces in the resulting document. An undeclared namespace is one that is not specified as part of the nsDecls input parameter.

    Set to:

    • true to preserve undeclared namespaces in the resulting document. For each namespace declaration in the XML document that is not specified in the nsDecls parameter, IBM webMethods Integration adds the xmlns attribute as a String variable to the document. IBM webMethods Integration gives the variable a name that begins with "@xmlns" and assigns the variable the namespace value specified in the XML document. IBM webMethods Integration preserves the position of the undeclared namespace in the resulting document.

    • falseto ignore namespace declarations in the XML document that are not specified in the nsDecls parameter. This is the default.

  • preserveNSPositions: String Optional - Flag indicating whether or not IBM webMethods Integration maintains the position of namespaces declared in the nsDecls parameter in the resulting document.

    Set to:

    • true to preserve the position of namespaces declared in nsDecls in the resulting document. For each namespace specified in the nsDecls parameter, IBM webMethods Integration adds the xmlns attribute to the document (IData) as a String variable named "@xmlns:NSprefix" where "NSprefix" is the prefix name specified in nsDecls. IBM webMethods Integration assigns the variable the namespace value specified in the XML document. This variable maintains the position of the xmlns attribute declaration within the XML document.

    • false to not maintain the position of the namespace declarations specified in nsDecls in the resulting document. This is the default.

  • useNamespacesOfDocumentType: String. Optional. Flag indicating whether or not IBM webMethods Integration uses the namespaces defined in the document type specified for the useNamespacesOf DocumentType documentTypeName input parameter when creating a document from an XML string. Set to:

    • True to use the namespaces defined in the document type specified in documentTypeName and those in nsDecls when creating elements in the output document.

    • False to use the namespaces defined in the nsDecls parameter only.

    Default value is false.

Output Parameters

  • document: Document - Document representation of the nodes and attributes in node.

xmlStreamToDocument

Converts an XML content stream to a document. This service transforms each element and attribute in the XML content stream to an element in a Document.

Input Parameters

  • xmlStream: java.io.InputStream - XML content stream that is to be converted to a document.

  • nsDecls []: Document Optional - Namespace prefixes to use for the conversion. This parameter specifies the prefixes that will be used when namespace-qualified elements are converted to key names in the resulting document object. For example, if you want elements belonging to a particular namespace to have the prefix GSX in the resulting document, for example, GSX:acctNum, you would associate the prefix GSX with that namespace in nsDecls . This is important because incoming XML documents can use any prefix for a given namespace, but the key names expected by a target service will have a fixed prefix. Namespace prefixes in nsDecls also define the prefixes used by the arrays, documents, documentTypeName, and collect parameters. Each entry in nsDecls represents a namespace prefix/URI pair, where a key name represents a prefix and the value of the key specifies the namespace URI. Parameters for nsDecls [] are:

    • prefix: Key name.
    • uri: Key value.
  • preserveUndeclaredNS: String Optional - Flag indicating whether or not IBM webMethods Integration keeps undeclared namespaces in the resulting document. An undeclared namespace is one that is not specified as part of the nsDecls input parameter.

    Set to:

    • true to preserve undeclared namespaces in the resulting document. For each namespace declaration in the XML document that is not specified in the nsDecls parameter, IBM webMethods Integration adds the xmlns attribute as a String variable to the document. IBM webMethods Integration gives the variable a name that begins with "@xmlns" and assigns the variable the namespace value specified in the XML document. IBM webMethods Integration preserves the position of the undeclared namespace in the resulting document.

    • false to ignore namespace declarations in the XML document that are not specified in the nsDecls parameter. This is the default.

  • preserveNSPositions: String Optional - Flag indicating whether or not IBM webMethods Integration maintains the position of namespaces declared in the nsDecls parameter in the resulting document.

    Set to:

    • true to preserve the position of namespaces declared in nsDecls in the resulting document. For each namespace specified in the nsDecls parameter, IBM webMethods Integration adds the xmlns attribute to the document as a String variable named "@xmlns:NSprefix" where "NSprefix" is the prefix name specified in nsDecls. IBM webMethods Integration assigns the variable the namespace value specified in the XML document. This variable maintains the position of the xmlns attribute declaration within the XML document.

    • false to not maintain the position of the namespace declarations specified in nsDecls in the resulting document. This is the default.

Output Parameters

  • document: Document - Document representation of nodes and attributes in node.

xmlStringToDocument

Converts an XML string to a document. This service transforms each element and attribute in the XML string to an element in a Document.

Input Parameters

  • xmlString: String - XML string that is to be converted to a document.

  • nsDecls []: Document Optional - Namespace prefixes to use for the conversion. This parameter specifies the prefixes that will be used when namespace-qualified elements are converted to key names in the resulting document object. For example, if you want elements belonging to a particular namespace to have the prefix GSX in the resulting document, for example, GSX:acctNum, you would associate the prefix GSX with that namespace in nsDecls . This is important because incoming XML documents can use any prefix for a given namespace, but the key names expected by a target service will have a fixed prefix. Namespace prefixes in nsDecls also define the prefixes used by the arrays, documents, documentTypeName, and collect parameters. Each entry in nsDecls represents a namespace prefix/URI pair, where a key name represents a prefix and the value of the key specifies the namespace URI. Parameters for nsDecls [] are:

    • prefix: Key name.
    • uri: Key value.
  • preserveUndeclaredNS: String Optional - Flag indicating whether or not IBM webMethods Integration keeps undeclared namespaces in the resulting document. An undeclared namespace is one that is not specified as part of the nsDecls input parameter.

    Set to:

    • true to preserve undeclared namespaces in the resulting document. For each namespace declaration in the XML document that is not specified in the nsDecls parameter, IBM webMethods Integration adds the xmlns attribute as a String variable to the document. IBM webMethods Integration gives the variable a name that begins with "@xmlns" and assigns the variable the namespace value specified in the XML document. IBM webMethods Integration preserves the position of the undeclared namespace in the resulting document.

    • false to ignore namespace declarations in the XML document that are not specified in the nsDecls parameter. This is the default.

  • preserveNSPositions: String Optional - Flag indicating whether or not IBM webMethods Integration maintains the position of namespaces declared in the nsDecls parameter in the resulting document.

    Set to:

    • true to preserve the position of namespaces declared in nsDecls in the resulting document. For each namespace specified in the nsDecls parameter, IBM webMethods Integration adds the xmlns attribute to the document as a String variable named "@xmlns:NSprefix" where "NSprefix" is the prefix name specified in nsDecls. IBM webMethods Integration assigns the variable the namespace value specified in the XML document. This variable maintains the position of the xmlns attribute declaration within the XML document.

    • false to not maintain the position of the namespace declarations specified in nsDecls in the resulting document. This is the default.

  • arrays []: String List Optional - Names of elements that are to be generated as arrays, regardless of whether they appear multiple times. For example, if arrays contained the following values for an XML document: rep and address, xmlStringToDocument would generate element rep as a String List and element address as a Document List. If you include namespace prefixes in the element names that you specify in arrays, you must define the namespaces associated with those prefixes in nsDecls.

  • makeArrays: String Optional - Flag indicating whether you want xmlStringToDocument to automatically create an array for every element that appears more than once.

    Set to:

    • true to automatically create arrays for every element that appears more than once. This is the default.

    • false to create arrays for only those elements specified in arrays.

Output Parameters

  • document: Document - Document representation of nodes and attributes in node.

xmlStringToXMLNode

Converts a String, byte[], or InputStream containing an XML document to an XML node.

An XML node is a representation of an XML document that can be consumed by IBM webMethods Integration.

Input Parameters

  • xmldata: String Optional - String containing the XML document to convert to an XML node. If you specify xmldata, do not specify $filedata or $filestream.

  • $filedata: byte[] Optional - byte[] containing the XML document to convert to an XML node. If you specify $filedata, do not specify xmldata or $filestream.

  • $filestream: java.io.InputStream Optional - InputStream containing the XML document to convert to an XML node. If you specify $filestream, do not specify xmldata or $filedata.

  • encoding: String Optional - Character encoding in which text is represented. Specify UTF-8 for XML files and ISO-8859-1 for HTML files. To have the parser attempt to detect the type of encoding, specify autoDetect, (which is the default, if encoding is not specified).

  • expandDTD: String. Optional. Flag indicating whetherreferences to parameter entities in the XML document's DTD are to be processed. Set to:

    • true to expand references to parameter entities to theirfull definition.

    • false to ignore references to parameter entities.

    Default value is false.

  • isXML: String Optional - Flag specifying whether the input document is XML or HTML. (xmlStringToXMLNode must know this so that it can parse the document correctly.) Set to:

    • autoDetect - To parse the document based on its type. When you use this option, xmlStringToXMLNode detects the document's type based on its document type declaration as indicated by a <!DOCTYPE...\> or <?XML...\> tag. If it cannot determine the document type, it parses it as HTML. This is the default.

    • true to parse the document as XML.

    • false to parse the document as HTML.

  • expandGeneralEntities: String. Optional. Flag indicating whether service should expand references to general entities in the XML document’s DTD. Set to:

    • true to expand references to general entities to their full definition.

    • false to ignore references to general entities.

    Default value is true.

  • validateXML: String. Optional. Flag indicating whether IBM webMethods Integration validates the incoming XML document to determine whether it is well-formed XML before converting the XML document. Set to:

    • true to validate the incoming XML. If validation fails, the service ends with a ServiceException.

    • false to skip validation.

    Default value is false.

Output Parameters

  • node: com.wm.lang.xml.Node - XML node representation of the XML document in xmlData. This object can be used as input to services that consume XML nodes.

Usage Notes

  • The input parameters xmldata, $filedata, and $filestream are mutually exclusive. Specify only one of the preceding parameters. IBM webMethods Integration checks the parameters in the following order: $filedata, $filestream, and xmldata, and uses the value of the first parameter with a value.

getXMLNodeIterator

Creates and retrieves a NodeIterator.

A NodeIterator iterates over the element node descendants of an XML node and returns the element nodes that satisfy the given criteria. The client application or flow service uses the service getNextXMLNode to get each node in turn. NodeIterators can only be created for XML nodes (not for HTML nodes).

getXMLNodeIterator is useful for loading and parsing documents on demand. NodeIterators are also useful for promptly delivering relevant information as it becomes available in the document, rather than waiting for the entire document to load initially. This service is particularly intended for handling large documents or documents that load gradually.

NodeIterator provides a moving-window mode in which the only node resident in memory is the last node returned by getNextXMLNode. In this mode, when getNextXMLNode is called, all nodes preceding the newly returned node become invalid, including those previously returned by getNextXMLNode. The client must fully complete processing preceding nodes before advancing the window by calling getNextXMLNode again. In moving-window mode, the document consumes at least enough memory to hold the most recently returned node.

The moving-window mode allows the server to process multi-megabyte XML documents using very little memory. This mode may only be used on a node that represents an entire XML document and not on any descendant node.

Input Parameters

  • Node: The XML node for which you want to create a NodeIterator can represent either an entire XML document or an element within an XML document. However, if the NodeIterator will be used in moving-window mode, it is necessary to use a complete XML document. This is because moving window mode is only meaningful for managing the loading process of a document, and operating on a node implies that the node has already been loaded.

  • Criteria: String List Optional. Pattern strings identify the nodes that the iterator is to return. A pattern string may take either the form <localname> or the form <prefix>:<localname>. When a pattern takes the first form, it identifies an element whose local name is <localname> and that belongs to the default XML namespace. When a pattern takes the second form, it identifies an element whose local name is <localname> and whose XML namespace is given by the prefix <prefix>. If the input parameter nsDecls declares this prefix, the namespace URI of the element must match the URI declared for the prefix. If the prefix is not declared in nsDecls, the prefix is matched against prefixes found in the XML. Both <prefix> and <localname> can each optionally take the value "*" to match any namespace or local name. A "*" prefix also matches elements residing in the default namespace. If you do not specify criteria, all element node children of the root element are returned.

  • nsDecls: Document Optional. Namespaces associated with any namespace prefixes used in criteria. Each entry in nsDecls represents a namespace prefix/URI pair, where a key name represents a prefix and the value of the key specifies the namespace URI.

  • movingWindow: String Optional. Flag indicating whether the NodeIterator is to iterate using a moving window, as described above. In moving-window mode, the entire document preceding the node most recently returned by getXMLNodeIterator is discarded. Subsequent attempts to return preceding portions of the document will yield either the repeating text PURGED or the proper data, depending on whether the data falls within an area that the server was able to discard. When iterating with a moving window, the current node should be queried and completely examined before requesting the next node. Set to:

    • true to use the NodeIterator in moving-window mode.
    • false to use the NodeIterator in normal mode. This is the default.

Output Parameters

Iterator: NodeIterator for use with the service getNextXMLNode.

getNextXMLNode

Retrieves the next XML node from a NodeIterator.

Input Parameters

Iterator: NodeIterator from which to retrieve the next node.

Output Parameters

Next Document Conditional. The requested node. It is null when the NodeIterator has no more nodes to return. Otherwise, next will contain the following:

Following are the service descriptions:

  • next: String Element type name of the node. If the element belongs to a namespace and the namespace was declared at the time the NodeIterator was constructed, name will have the prefix declared for that namespace. If the namespace is not declared, name will use prefix that occurs in the XML.
  • node: XML node identified by the input criteria used to originally generate the NodeIterator.

It is possible that all calls to getNextXMLNode on a given NodeIterator will yield the same document instance, with varying values for the instance's entries. Therefore, applications should assume that each call to getNextXMLNode invalidates the document returned by the previous call. This approach maximizes server speed and minimizes resource usage.

Usage Notes

A NodeIterator is acquired via the service getXMLNodeIterator. The output of that service is a document containing the element type name of the node and the node itself. The instance of this document is only valid until the next getNextXMLNode call on the same NodeIterator, because getNextXMLNode uses the same document object for each call.

freeXMLNode

Frees the resources allocated to a given XML node.

You can optionally invoke this service when using a NodeIterator to iterate over an XML node, and you decide to halt the processing of the node before reaching the end. By explicitly calling freeXMLNode, you immediately release the resources associated with the node. While it is not mandatory to call this service upon completing the processing of an XML node with a NodeIterator, doing so can enhance server performance. Note that once you have freed an XML node using this service, the node becomes unstable and should not be utilized by any subsequent processes.

Input Parameters

rootNode: XML node whose resources you want to release. Specify the same type of input that you supplied to getXMLNodeIterator.

Output Parameters

None.

E2E Monitoring Services

setCustomTransactionId

You can specify a custom transaction ID as part of your IBM webMethods Integration Flow services. This persists as part of your transaction trace stored in End-to-End Monitoring. A custom transaction ID allows you to reference or search a transaction based on your own identifier such as order ID or shipping reference.

Use this function to set the custom transaction ID in End-to-End Monitoring. You can use this function multiple times in the same Flow Service or associated child services. Using this function appends the values with delimiter commas and sets it to End-to-End Monitoring custom transaction ID. After setting the custom transaction ID, you can use any of these values to search for the transaction in End-to-End Monitoring, and to create Deep Link URLs.

Input Parameters

e2eTransactionId: String - Custom transaction ID that uniquely identifies the End-to-End Monitoring transaction.

Output Parameters

None.

Note: 1024 characters is the maximum length of the values this function can set in End-to-End Monitoring, including the delimiter commas. New values do not get appended on exceeding this maximum length.

setCustomTransactionIds

You can specify a custom transaction ID as part of your IBM webMethods Integration Flow services. This persists as part of your transaction trace stored in End-to-End Monitoring. A custom transaction ID allows you to reference or search a transaction based on your own identifier such as order ID or shipping reference.

Use this function to set the custom transaction ID in End-to-End Monitoring as an array of key value pairs. You can use this function to set multiple key value pairs in a single call as it accepts an array input. You can use this function multiple times in the same Flow Service or associated child services. Using this function equates the keys to the values with the equal to (=) character, and appends the multiple key value pairs with delimiter commas and sets them to End-to-End Monitoring custom transaction ID. After setting the custom transaction ID, you can use any of these values to search for the transaction in End-to-End Monitoring, and to create Deep Link URLs.

Input Parameters

e2emTransactionIds: Document List - Custom transaction IDs as key-value pairs that uniquely identify the End-to-End Monitoring transaction.

Output Parameters

None.

Note:
  • 1024 characters is the maximum length of the values this function can set in End-to-End Monitoring, including the delimiter commas, keys, values and equal to (=) characters. New values do not get appended on exceeding this maximum length.

  • You can search for the key or the value in End-to-End Monitoring user interface. However, you cannot search for key-value pairs in the key=value format as End-to-End Monitoring filters do not support special characters. In contrast, deep link URLs support key-value pairs.

JWT

JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely exchanging information as a JSON object between parties.

The following JWT services are available:

Following are the service descriptions:

  • extractClaimsFromJW: Returns specific claim details that you want to extract from a JWT.
  • generateSignedJWT: Generates a signed JWT.
  • verifyJWT: Verifies the signature in a JWT, the token expiration time, and the not-before time.

extractClaimsFromJWT

This service returns specific claim details that you want to extract from a JWT. You can request a specific claim using the input parameter claims.

Input Parameters

jwt: String. The token from which you want to extract claims.

truststoreAlias: String. Alias of the truststore that contains the list of certificates, which server uses to verify the JWT before extracting the claims.

certAlias: String. Alias that identifies a trusted certificate within a truststore.

claims: String[]. List of claims to be extracted.

Output Parameters

message: String. Indicates whether the claims are successfully extracted or not. A success message or an error message followed by the details of claims extracted are displayed.

claimsDetails: Document. The service returns an array or a list of name and value pair for each claim.

Usage Notes

  • When the service parses a JWT that contains a number, the output of this service can be any of the subtypes of a number that best fits the value. For example: If the number fits an integer, then integer is returned.
  • If the token has numbers with values greater than 1e308, then the results are unpredictable.

generateSignedJWT

Generates a signed JWT from server.

Input Parameters

algorithm: String. The cryptographic algorithm used to sign a JWT. Supported algorithms are:

  • RS512
  • RS384
  • RS256

keyStoreAlias: String. Alias of the keystore containing private key required to sign a JWT.

keyAlias: String. Alias of the private key used to sign a JWT.

allowWeakKey: Boolean. Indicates whether an RSA key shorter than 2048 bits in a cryptographic algorithm is allowed or not. A value of: - true allows an RSA key shorter than 2048 bits in a cryptographic algorithm. - false does not allow an RSA key shorter than 2048 bits in a cryptographic algorithm. This is the default.

subject: String. Optional. Identifies the principal, which is the subject of the JWT.

issuer: String. Optional. Specifies the name of the JWT token issuer.

audience: String []. Optional. Specifies the intended recipients of the token.

expirationTime: String. Optional. Identifies the time on or after which the JWT must not be accepted for processing. The expiration date or time must be equal to or later than the current date or time. The required date format is "dd/MM/yyyy HH:mm:ss".

notBeforeTime: String. Optional. Identifies the time before which the JWT must not be accepted for processing. The not-before date or time must be equal to or earlier than the current date or time. The required date format is "dd/MM/yyyy HH:mm:ss".

addIssuedAtTimeClaim: Boolean. Indicates whether issuedAtTime (iat) claim is added to the generated signed JWT or not. A value of: - true indicates that the issuedAtTime (iat) claim is added to the generated signed JWT. - false indicates that the issuedAtTime (iat) claim is not added to the generated signed JWT. This is the default.

jwtId: String. Optional. A unique identifier for the JWT. The value is a case-sensitive string.

customClaims: Document List. Optional. A list of custom claims. Each claim has 3 parts:"name", "value", and "type". - name: String. Name of the claim. - value: String[]. The array to provide one or more values for a custom claim. - type: String. Any valid JSON data type except null. Supported valid JSON data types are: String, Boolean, Number, JSONArray and JSONObject.

Output Parameters

jwt: String. Signed JWT.

Usage Notes

  • The customClaims parameter in this service accepts only valid JSON data types such as String, Boolean, Number, JSONArray, and JSONObject except null.
  • If you provide duplicate claim names to the customClaims parameter, then the values corresponding to the latest duplicate claim name are used to generate the JWT.
  • If you want to specify jwtId manually, you can use the pub.utils:generateUUID public service to generate a random Universally Unique Identifier (UUID) and map it to jwtId.
  • If the token has numbers with values greater than 1e308, then the results are unpredictable.
  • If you specify a custom claim with empty or a null value, then such claims will be absent in the generated JWT.
  • You can provide one or more inputs to the "value" field in customClaims. The output is displayed as an array. For example, custom claim "Address" can have multiple values, then the output for this claim is displayed as an array.

verifyJWT

WmPublic. Verifies the signature in a JWT, the token expiration time, and the not-before time. The expirationTime identifies the time, on or after which the JWT is not accepted for processing. The expiration date or time must be equal or later than to the current date or time.

The notBeforeTime identifies the time before which the JWT is not accepted for processing. The not-before date or time must be equal to or earlier than the current date or time.

Input Parameters

jwt: String. The token to be verified.

truststoreAlias: String. Alias of the truststore that contains the list of certificates, which server uses to verify the JWT.

certAlias: String. Alias that identifies a particular trusted certificate within a truststore.

Output Parameters

isJWTverified: Boolean. Indicates whether the JWT is verified or not. A value of: - true indicates that the JWT is verified. - false indicates that the JWT is not verified.

message: String. Success message if verified or a failed message with reason.

SMIME

Create digitally signed and/or encrypted MIME messages. You also use the services in this folder to process signed and encrypted MIME messages that are passed into the pipeline.

Following are the service descriptions:

  • createCertsOnlyData: Generates a PKCS #7 certs-only S/MIME entity from an array of certificates.
  • createEncryptedData: Encrypts a MIME message.
  • processCertsOnlyData: Extracts the certificates from a PKCS #7 certs-only S/MIME entity.
  • processSignedData: Verifies the signature from a signed S/MIME entity and extracts the message from it.

createCertsOnlyData

Generates a PKCS #7 certs-only S/MIME entity from an array of certificates. This service can be used to develop mechanisms for transmitting certificates and certificate chains to other parties.

Input Parameters

certificates: byte[] The certificates that are to be encapsulated within the S/MIME entity. Each byte[] represents a single certificate.

Output Parameters

SMimeEnvStream: java.io.InputStream S/MIME entity.

createEncryptedData

Encrypts a MIME message.

Input Parameters

envStream: java.io.InputStream MIME message that you want to encrypt (for example, the output produced by getEnvelopeStream service under MIME group).

recipientCerts: byte[] The X.509 certificates of the recipients for whom this message will be encrypted. Each element in the list represents a certificate for a single recipient in the form of a byte[].

Note: When you have multiple recipients, createEncryptedData creates a single message that is encrypted for all recipients. It does not create a separate message for each recipient.

encryptionAlg: String Optional. Code specifying the encryption algorithm to use. Must be TripleDES (default), DES, or RC2.

keyLength: String Optional. Length of the encryption key for RC2 encryption. Must be 40, 64, or 128 (default). This parameter is ignored if encryptionAlg is not RC2.

Output Parameters

SMimeEnvStream: java.io.InputStream The encrypted MIME message.

processCertsOnlyData

WmPublic. Extracts the certificates from a PKCS #7 certs-only S/MIME entity.

Input Parameters

SMimeEnvStream: java.io.InputStream The certs-only S/MIME entity.

Output Parameters

certificates: byte[] The extracted certificates. Each element in the list contains one of the extracted certificates represented as a byte[].

processSignedData

Verifies the signature from a signed S/MIME entity and extracts the message from it.

Input Parameters

SMimeEnvStream: java.io.InputStream Signed MIME entity (for example, the output produced by createSignedData from SMIME).

signerCertChain: byte[] Optional. Certificate chain of the party that signed the message, where each byte[] represents a single certificate in the chain. Certificates must appear in hierarchical order, starting with the signer's certificate in element 0. The following shows how the elements of a complete chain would appear for a certificate that was issued through two intermediate CAs:

Element Contents
0 Signer's certificate.
1 Intermediary CA Certificate.
2 Intermediary CA Certificate.
3 Root CA Certificate.

NOTEIf the signer included the certificate chain with the digital signature, you do not need to supply signerCertChain.

Output Parameters

mimeData: Document MIME object containing the extracted MIME entity.

contentDigest: String Message digest (base64-encoded) that was recalculated by processSignedData.

signerCert: java.security.cert.X509Certificate Signer's X.509 certificate.

encrypted: String Conditional. Flag indicating whether the extracted MIME entity is encrypted. A value of: - true indicates that the MIME entity is encrypted. - false indicates that the MIME entity is not encrypted.

signed: String Conditional. Flag indicating whether the extracted MIME entity is signed. A value of: - true indicates that the MIME entity is signed. - false indicates that the MIME entity is not signed.

certsOnly: String Conditional. Flag indicating whether the extracted MIME entity is a certs-only entity. A value of: - true indicates that the MIME entity is a certs-only entity. - false indicates that the MIME entity is not a certs-only entity.

stream: java.io.InputStream Conditional. Extracted MIME entity.

verify: String Flag indicating whether the signature was successfully processed. Success indicates that the signature was successfully verified with the supplied public key. A value of: - true indicates that signature processing was successful. -false indicates that signature processing failed. The signature could not be verified because an errorCode 1, 2, 3, or 4 occurred.

trusted: String Flag indicating whether the signer certificate is trusted or not. A value of: - true indicates that the signer certificate is trusted. - false indicates that the signer certificate is not trusted.

errorCode: String Conditional. Number indicating the kind of error that occurred while processing the signature. See errorMessage for possible values. If no error occurred, errorCode will not be returned.

errorMessage: String Conditional. Textual error message indicating what kind of error occurred while processing the signature. Error codes and messages are as follows:

errorCode errorMessage
1 Invalid signer certificate file information.
2 Certificate at index 'i' is not in recognizable format.
3 Invalid certificate input at index 'i'.
4 Signature cannot be verified.
5 Expired certificate chain.
6 Error in certificate chain.
7 Untrusted certificate

Usage Notes

  • If verify is false, the errorCode and errorMessage values will indicate the error that caused the failure. Note that errorCode values 5 through 7 do not represent signature-validation failures and, therefore, do not cause the verify flag to be set to false.
  • If the extracted entity is signed or encrypted, mimeData will be empty, and the extracted entity will reside in stream. You can check the state of the signed and encrypted output variables to determine whether the extracted entity requires additional processing, and pass stream to the processEncryptedData service as necessary.

IMPORTANT You can examine the contents of mimeData during testing and debugging. However, because the internal structure of mimeData is subject to change without notice, do not explicitly set or map data to/from these elements in your service. To manipulate or access the contents of mimeData, use only the MIME services that server provides.

createSignedData

WmPublic. Creates signed S/MIME data.

Input Parameters

envStream: java.io.InputStream MIME message that you want to sign (for example,the output produced by pub.mime:getEnvelopeStream).

keyStoreAlias: String Alias of the keystore.

keyAlias: String Alias of the private key of interest in the keystore.

explicit: String Optional. Flag indicating whether an implicit or explicit signature is generated. Set to: - True to generate an explicit (detached) signature. This is the default. - False to generate an implicit signature.

signingAlg: String Optional. The signing algorithm to use to sign the S/MIME messages. Set to: - SHA1 - SHA224 - SHA256 - SHA384 - SHA512 The default is SHA1.

Note: If you do not set this parameter, server uses SHA1 algorithm to sign the incoming messages.

Output Parameters

SMimeEnvStream: java.io.InputStream The signed MIME stream.

processEncryptedData

Decrypts an encrypted S/MIME message.

Input Parameters

SMimeEnvStream: java.io.InputStream The encrypted S/MIME stream.

keyStoreAlias: String Alias of the keystore containing the decryption key.

keyAlias: String Alias of the key used for decryption.

Output Parameters

mimeData: Document The decrypted MIME message.

contentDigest: String Message digest of the encrypted content, base64-encoded. (Some sites return this digest to the sender to acknowledge their receipt of the message.

encrypted: String Flag indicating whether the MIME entity passed in to the service was encrypted. A value of: - True indicates that the MIME entity was encrypted. - False indicates that the MIME entity was not encrypted.

signed: String Flag indicating whether the MIME entity passed in to the service was signed. A value of: - True indicates that the MIME entity is signed. - False indicates that the MIME entity is not signed.

certsOnly: String Flag indicating whether the MIME entity passed in to the servicen contained only digital certificates. A value of: - True indicates that the MIME entity is a certs-only entity. - False indicates that the MIME entity is not a certs-only entity.

stream: java.io.InputStream The decrypted MIME entity.

Document

Perform operations on documents in the pipeline.

documentToXMLValues: Converts a document (IData object) to a String by encoding it in the webMethods XMLValues format.

XMLValuesToDocument: Decodes a String containing an XMLValues-encoded document and produces a document (IData object).

documentToXMLValues

WmPublic. Converts a document (IData object) to a String by encoding it in the webMethods XMLValues format.

Input Parameters

document: Document Document (IData object) to convert. This document can contain any number of other fields, lists, and other documents.

Output Parameters

xmlvalues: String String representation of the document parameter, encoded in the webMethods XMLValues format.

Usage Notes

  • To convert the encoded String back into an document object, use the XMLValuesToDocument service.

XMLValuesToDocument

Decodes a String containing an XMLValues-encoded document and produces a document.

Input Parameters

xmlvalues: String An XMLValues encoding of a document.

IMPORTANT This String must contain XMLValues encoding of a document. No other encoding format is accepted.

Output Parameters

document: Document Document result of the decoding of xmlvalues.

pkcs7

sign

Creates a PKCS7 signed Data object.

Input Parameters

signerInfo: Document List Information about a single signer of the signed data object. Each signerInfo requires either a certificate chain and a private key or a key alias that references them. - keyStoreAlias: String Name of the keystore alias. - keyAlias: String Alias of the private key. - hashAlgorithm: String The algorithm to use when computing the digest of the provided data. Specify: - MD5 (the default) - SHA-1 - SHA-256 - SHA-384 - SHA-512

data: byte[] Optional. Data in the form of a byte array to be digitally signed.

Note: If both data and dataAsStream are provided, dataAsStream takes precedence.

dataAsStream: java.io.InputStream Optional. Data in the form of an input stream to be digitally signed.

Note: If both data and dataAsStream are provided, dataAsStream takes precedence.

detachedSignature: String Flag specifying whether to generate a detached signature. A detached signature does not include the data that was signed. Set to: - true to generate a detached signature. - false to generate an implicit signature (one that includes the signed data). This is the default.

Output Parameters

signature: byte[] Conditional. Signature generated in the form of a byte array from the supplied data. This is a DER-encoded representation of the SignedData object as specified in PKCS#7. signature is returned when the input parameter data is provided.

signatureAsStream: java.io.OutputStream Conditional. Signature generated in the form of an output stream from the supplied data. signatureAsStream is returned when the input parameter dataAsStream is provided.

verify

Verifies signed data.

Input Parameters

data: Document. Signed data that you want to verify. The data must be in one of the following formats. If multiple input parameters are supplied for data, the service throws an exception stating that only one parameter must be passed. - string: String. Optional. The signed string that you want to verify. - stream: java.io.InputStream. Optional. The signed stream data that you want to verify. - bytes: byte[]. Optional. The signed byte array that you want to verify.

loadAs: String. Optional. The format in which the service returns the output. Set to: - bytes to return the output as a byte array. This is the default. - stream to return the output as a stream object. - string to return the output as a string.

publicKey: Document. The signer's public key required to verify the signed data. Provide publicKeyBytes, publicKeyString. - publicKeyBytes: Object List. Optional. One or more public key files as byte arrays.

Note: Public key files have a .asc extension.
<br>
                    - publicKeyString: String List. Optional. One or more public keys as
                    strings.<br>

Output Parameters

stream: java.io.OutputStream. Conditional. Verified data as an output stream. Returned when the loadAs input parameter is set to stream.

bytes: byte[]. Conditional. Verified data in bytes. Returned when the loadAs input parameter is set to bytes.

string: String. Conditional. Verified data as a string. Returned when the loadAs input parameter is set to string.

verified: Boolean. Indicates whether the signature associated with the data is valid or not. A value of: - true indicates that the signed data is verified. - false indicates that the signed data is not verified.

status: String. Indicates whether the data is successfully verified or not. If successful, status is success. Otherwise, status contains failure along with an error message.

Usage Notes

  • To verify signed data, server must have access to the signer's public key.
  • To verify the data for multiple users, provide the users' public keys to the service as a list of byte arrays, strings, or a keyring file.
  • If you provide a keyring file, you must also provide the public key aliases. The verify service cannot verify a detached signature.
  • Authentication keys used in this service must be in the PGP format and generated using the RSA encryption algorithm.
Note: Authentication keys in the .ecc format are not supported.

String

Perform string manipulation and substitution operations.

  • isNullEmptyOrWhitespace: Determines if a string is null, empty, or only whitespace.
  • lookupTable: Locates a key in a String Table and returns the string to which that key is mapped.

isNullEmptyOrWhitespace

Determines if a string is null, empty, or only whitespace.

Input Parameters

inString: String Optional. String to be checked.

ifPresent: Boolean Optional. - If the value is set to true, the service checks whether inString is present or not, and only then proceeds with validation of the input. - If the value is set to false, the service throws an exception when inString is absent. Else, the service proceeds to validate the input.

Output Parameters

isNullEmptyOrWhitespace: String Indicates whether inString is null, empty, or only whitespace. - true indicates that inString has a null value, is empty, or is only whitespace. - false indicates that inString is not null, not empty, or is not only whitespace.

Examples: Service with inString = " \t\n\r\n" and ifPresent = true, returnstrue Service with inString=" \t\n\r\n" and ifPresent = false, returnstrue Service with inString = "abcd" and ifPresent = true, returns false Service with inString = "abcd" and ifPresent = false, returns false Service with ifPresent = true, returns true Service with ifPresent = false, throws an exception.

Usage Notes

isNullEmptyOrWhitespace replaces isNullOrBlank which is deprecated.

lookupTable

Locates a key in a String Table and returns the string to which that key is mapped.

Input Parameters

lookupTable: String [] [] A multi-row, multi-column string table in which to search.

keyColumnIndex: String Index of the "key" column. Default is 0.

valueColumnIndex: String Index of the "value" column. Default is 1.

key: String Key to locate.

Note: The key is case sensitive.

ignoreCase: String Optional. Flag indicating whether to perform a case-sensitive or case-insensitive search. Set to: - true to perform a case-insensitive search. - false to perform a case-sensitive search. This is the default.

useRegex: String Optional. Flag indicating whether the values in the table are to be interpreted as regular expressions.

Note: The regular expressions in the table should not include slashes. Fo example, use hello., not /hello./. > Set to: > - true to interpret the key column values in the table as regular expressions. > - false to interpret the key column values in the table as literal values(that is, not regular expressions). This is the default.

Output Parameters

value: String First value in the "value" column whose key matches key. If no match is found, this parameter is null.

Keystore

keystore:getCertificate

Returns the trusted certificate, stored in a truststore, that corresponds to the certificate's alias.

Input Parameters

trustStoreAlias: String Alias for the truststore containing the certificate.

certAlias: String Alias identifying a particular trusted certificatewithin a truststore.

Output Parameters

certificate: byte[] A byte array containing the trusted certificate.

getTrustedCertificates

Returns the trusted certificates located in a specified truststore.

Input Parameters

trustStoreAlias: String Name of the truststore alias.

Output Parameters

certificates: byte[] Trusted certificates, as a list of byte arrays.

security

Control which client certificates are sent to other services and digitally sign data and process digital signatures. You can also use the elements to store and retrieve outbound passwords to access secure resources.

generateHashValue

Returns the hashed value for a string input.

Input Parameters

inputString: String. The string that you want to convert to a hash value.

hashAlgorithm: String. Optional. The algorithm to generate the hash value. Select one of the following:

  • MD5
  • SHA256
  • SHA384
  • SHA512 The default value is SHA256.

saltValue: byte[]. Optional. A random value that you can prefix to the input string before hashing.

Note: To use a salt value in this service, run the generateSalt service and map the generated salt value to this parameter.

Output Parameters

hashedValue: String. Hashed value of the input string.

status: String. Indicates whether the inputString is successfully hashed or not. If successful, status is success. Otherwise, status contains failure along with an error message.

Usage Notes

  • Use the generateHashValue service to generate a hash value for any input string. For example, you can create a secure hashedValue for a user's password.
  • Additionally, you can run the generateSalt service to generate a salt value, which can be passed to the generateHashValue service to generate a unique and stronger hashedValue, each time you run the generateHashValue service.

generateSalt

Creates a salt value.

Input Parameters

None.

Output Parameters

saltValue: byte[]. Salt value to be used for hashing purposes.

status: String. Indicates whether a salt value is generated or not. If successful, status is success. Otherwise, status contains failure along with an error message.

Usage Notes

Use the saltValue output of this service as input to the generateHashValue service.

decryptAndVerify

Decrypts the encrypted data and verifies the associated digital signature.

Input Parameters

securityProvider: String Optional. The type of security provider. The valid values are: PGP (Pretty Good Privacy), JCE-KBE (Java Cryptography Extension-Key Based Encryption). The default value is PGP

data: Document The data that you want to decrypt and verify must be in one of the following formats. If multiple input parameters are supplied for data, the service throws an exception stating that only one parameter must be passed. - string: String. Optional. The string that you want to decrypt and verify. - stream: java.io.InputStream Optional. The stream data that you want to decrypt and verify. - bytes: byte[] Optional. The byte array that you want to decrypt and verify.

loadAs: String. Optional The format in which the service returns the output. Set to: - bytes to return the output as a byte array. This is the default. - stream to return the output as a stream object. - string to return the output as a string.

secretKey: Document The secret key to extract the private key required to decrypt the data. For PGP, provide secretKeyBytes,secretKeyString. ForJCE-KBE, provide secretKeyBytes or keyStoreAlias. If you provide keyStoreAlias, you must provide keyAlias. Otherwise, the service throws an exception. - secretKeyBytes: byte[] Optional. The secret key file in bytes.Note: Secret key files have a .asc extension for PGP. - secretKeyString: String Optional. The secret key as a string. - secretKeyPassphrase: String Password required to extract the private key from the secret key. This is the password provided while generating the secret key. This parameter is specific to PGP. - keyStoreAlias: String Optional. Applies only to JCE. The keystore alias that contains the private key used for decryption. - keyAlias: String Optional. Applies only to JCE. The private key alias in the keystore specified by the keyStoreAlias parameter that is used for decryption.

Note: This parameter is required only when you use keyStoreAlias.

publicKey: Document The public key required to verify the digital signature associated with the data.For PGP, provide publicKeyBytes, publicKeyString. For JCE-KBE, provide publicKeyBytes, publicKeyString. - publicKeyBytes: Object List Optional. One or more public key files as byte arrays for PGP. JCE supports only a single public key file.

Note: Public key files have a .asc extension.
 - publicKeyString: String List Optional. One or more public keys as
                    strings for PGP. JCE supports only a single public key string.<br>
                    - truststoreAlias: String Optional. Applies only to JCE. The alias for the
                    truststore containing the public key and certificate.
Note: This parameter is applicable only for JCE.
 - certAlias: String Optional. Applies only to JCE. The alias identifying
                    a particular trusted certificate within a truststore.
Note: This parameter is applicable only for JCE and is required only when you use truststoreAlias.
signingAlgorithm: String The signing algorithm to use. For PGP, select one of the following: - SHA256 - SHA384 - SHA512 The default value is SHA256 for PGP. For JCE, select one of the following: - RSA - SHA256withRSA - SHA512withRSA - SHA3-256withRSA - SHA3-384withRSA - SHA3-512withRSA
Note: If the secret key for signing the data is of the DSA (Digital Signature Algorithm) key type, this service does not support the MD5 signing algorithm. This is applicable only for PGP.

cipher: String Optional. Applies only to JCE. The cipher for decryption. Select one of the following: - RSA - RSA/ECB/PKCS1Padding - RSA/ECB/OAEPWithSHA-1AndMGF1Padding - RSA/ECB/OAEPWithSHA-256AndMGF1Padding - RSA/ECB/OAEPWithSHA-512AndMGF1Padding - RSA/ECB/OAEPPadding The default value is RSA.

Output Parameters

stream: java.io.OutputStream Conditional. Decrypted and verified data as an output stream. Returned when the loadAs input parameter is set to stream.

bytes: byte[] Conditional. Decrypted and verified data as bytes. Returned when the loadAs input parameter is set to bytes.

string: String Conditional. Decrypted and verified data as a string. Returned when the loadAs input parameter is set to string.

verified: Boolean Indicates whether the signature associated with the data is verified or not. A value of: - true indicates that the signed data is verified. - false indicates that the signed data is not verified.

status: String Indicates whether the data is successfully decrypted and verified. If successful, status is success. Otherwise, status contains failure along with an error message.

Usage Notes

  • Use the decryptAndVerify service when an external system connected to server requires decrypted data with verified signature.

  • Prerequisites to use the decryptAndVerify service:

    • Generate a public-secret key pair for server.
    • Make sure that the external system has access to the server's public key.
    • Make sure that the server has access to external's system's public key.
  • Decryption and verification work as follows:

    • The external system sends the data encrypted with server's public key and signed with its secret key.
    • The server receives the data and passes it to the decryptAndVerify service.
    • The service uses the private key extracted from the secret key to decrypt the data.
    • The service then uses the external system's public key to verify the signature of the decrypted data.
    • The service returns the decrypted and verified data.
  • For PGP, conisder the following points:

    • To decrypt and verify the data signed and encrypted for multiple users, you must provide your secret key and the users' public keys to the service. You can provide the public keys to the service as a list of byte arrays, strings, or a keyring file. If you provide a keyring file, you must also provide the public key aliases.
    • Authentication keys used in this service must be in the PGP format and generated using the RSA encryption algorithm.
Note: Authentication keys in the .ecc format are not supported.
  • For JCE, conisder the following points:
  • You can decrypt and verify the data signed and encrypted for a single user only.
  • The service supports a maximum data size that depends on the key size.

decrypt

Decrypts the encrypted data and returns plain data as a stream object or a byte array.

Input Parameters

data: Document The data that you want to decrypt must be in one of the following formats. If multiple input parameters are supplied for data, the service throws an exception stating that only one parameter must be passed. - string String. Optional. The string that you want to decrypt. - stream java.io.InputStream. Optional. The stream data that you want to decrypt. - bytes byte[]. Optional. The byte array that you want to decrypt.

loadAs: String Optional. The format in which the service returns the output. Set to: - bytes to return the output as a byte array. This is the default. - stream to return the output as a stream object. - string to return the output as a string.

secretKey: Document The secret key to extract the private key required to decrypt the data. For PGP, provide secretKeyBytes, secretKeyString. For JCE-KBE, provide secretKeyBytes, secretKeyString, or keyStoreAlias. If you provide keyStoreAlias, you must provide keyAlias. Otherwise, the service throws an exception. - secretKeyBytes byte[] Optional. The secret key file in bytes.

Note: Secret key files have a .asc extension for PGP.
 - secretKeyString String Optional. The secret key as a string.<br>
                    - secretKey Passphrase String Password required to extract the private key from
                    the secret key. This is the password provided while generating the secret
                    key.<br>
                    - keyStoreAlias String Optional. Applies only to JCE. The keystore alias that
                    contains the private key used for decryption.<br>
                    - keyAlias String Optional. Applies only to JCE. The private key alias in the
                    keystore specified by the keyStoreAlias parameter that is used for
                    decryption.

                    
Note: This parameter is required only when you use realistically.

Output Parameters

stream: java.io.OutputStream Conditional. Decrypted data as an output stream. Returned when the loadAs input parameter is set to stream.

bytes: byte[] Conditional. Decrypted data as bytes. Returned when the loadAs input parameter is set to bytes.

string: String Conditional. Decrypted data as a string. Returned when the loadAs input parameter is set to string.

status: String Indicates whether the data is successfully decrypted or not. If successful, status is success. Otherwise, status contains failure along with an error message.

Usage Notes

Prerequisites to use the decrypt service:

  • Generate a public-secret key pair for server.
  • Make sure that the external system that sends the encrypted data has access to server's public key to encrypt the data.

Decryption works as follows:

  1. The external system sends the data encrypted with server's public key.
  2. The server receives the data and passes it to the pub.security:decrypt service.
  3. The decrypt service uses the private key to decrypt the data.
  4. The service returns the decrypted data.
  • For PGP, consider the following points: Authentication keys used in this service must be in the PGP format and generated using the RSA encryption algorithm.

Note: Authentication keys in the .ecc format are not supported for PGP.

For JCE, the service supports a maximum data size that depends on the key size.

encrypt

Converts plain data to encrypted data.

Input Parameters

securityProvider: String Optional. The type of security provider. The valid values are: - PGP (Pretty Good Privacy) - JCE-KBE (Java Cryptography Extension-Key Based Encryption) The default value is PGP. data: Document Data that you want to encrypt. The data must be in one of the following formats. If multiple input parameters are supplied for data, the service throws an exception stating that only one parameter must be passed. - string: String Optional. The string that you want to encrypt. - stream: java.io.InputStream Optional. The stream data that you want to encrypt. - bytes: byte[] Optional. The byte array that you want to encrypt.

loadAs: String Optional. The format in which the service returns the output. Set to: - bytes to return the output as a byte array. This is the default. - stream to return the output as a stream object. - string to return the output as a string.

publicKey: Document The public key required to encrypt the data. For PGP, provide publicKeyBytes, publicKeyString, or publicKeyRingFile. For JCE-KBE, provide publicKeyBytes, publicKeyString, or truststoreAlias. If you provide truststoreAlias, you must also provide certAlias. Otherwise, the service throws an exception. Following are the key descriptions: - publicKeyBytes: Object List Optional. One or more public key files as byte arrays for PGP. JCE supports only a single public key file.

Note: Public key files have a .asc extension for PGP.
 - publicKeyString: String List Optional. One or more public keys as
                    strings for PGP. JCE supports only a single public key string.<br>
                    - truststoreAlias: String Optional. Applies only to JCE. The alias for the
                    truststore containing the public key and certificate.<br>
                    - certAlias: String Optional. Applies only to JCE. The alias identifying a
                    particular trusted certificate within a truststore.
Note: This parameter is required only when you use truststoreAlias.

encryption Algorithm: String The key encryption algorithm to use. For PGP, select one of the following symmetric key encryption algorithms: - AES_192 - AES_256 - BLOWFISH - IDEA - TRIPLE_DES - TWOFISH The default value is AES_256. For JCE, select RSA (asymmetric key encryption algorithm).

cipher: String Optional. Applies only to JCE. The cipher for encryption. Select one of the following: - RSA - RSA/ECB/PKCS1Padding - RSA/ECB/OAEPWithSHA-1AndMGF1Padding - RSA/ECB/OAEPWithSHA-256AndMGF1Padding - RSA/ECB/OAEPWithSHA-512AndMGF1Padding - RSA/ECB/OAEPPadding The default value is RSA.

Output Parameters

stream: java.io.OutputStream Conditional. Encrypted data as an output stream. Returned when the loadAs input parameter is set to stream.

bytes: byte[] Conditional. Encrypted data as bytes. Returned when the loadAs input parameter is set to bytes.

string: String Conditional. Encrypted data as a string in the ASCII-armored format. Returned when the loadAs input parameter is set to string.

status: String Indicates whether the data is successfully encrypted or not. If successful, status is success. Otherwise, status contains failure along with an error message.

Usage Notes

For PGP, consider the following points:

  • Before encrypted data is exchanged between server and an external system, the external system must share its public key. The service accepts multiple public keys to encrypt the same data for many users.
  • The public key is passed to the encrypt service, which returns the encrypted data to server.
  • To encrypt the data for multiple users, provide the users' public keys to the service as a list of byte arrays, strings.
  • Authentication keys used in this service must be in the PGP format and generated using the RSA encryption algorithm.
Note: Authentication keys in the .ecc format are not supported for PGP.

For JCE, consider the following points:

  • You can encrypt the data for a single user only. Provide the public key to the service as a list of byte array, string, or truststoreAlias. If you provide truststoreAlias, you must also provide certAlias.
  • The service supports a maximum data size that depends on the key size.

sign

Adds a digital signature to data.

Input Parameters

securityProvider String Optional. The type of security provider. The valid values are: - PGP (Pretty Good Privacy) - JCE-KBE (Java Cryptography Extension-Key Based Encryption) The default value is PGP.

data: Document Data that you want to sign. The data must be in one of the following formats. If multiple input parameters are supplied for data, the service throws an exception stating that only one parameter must be passed. - string: String Optional. The string that you want to sign. - stream: java.io.InputStream Optional. The stream data that you want to sign. - bytes: byte[] Optional. The byte array that you want to sign.

loadAs: String Optional. The format in which the service returns the output. Set to: - bytes to return the output as a byte array. This is the default. - stream to return the output as a stream object. - string to return the output as a string.

secretKey: Document The secret key required to sign the data. For PGP, provide secretKeyBytes, secretKeyString. For JCE-KBE, provide secretKeyBytes, secretKeyString, or keyStoreAlias. If you provide keyStoreAlias, you must provide keyAlias. Otherwise, the service throws an exception. - secretKeyBytes: byte[] Optional. The secret key file in bytes.

Note: Secret key files have a .asc extension for PGP.
Note: This parameter is required only when you use keyStoreAlias.

signingAlgorithm:String The signing algorithm to use. For PGP, select one of the following: - SHA256 - SHA384 - SHA512 The default value is SHA256 for PGP. For JCE, select one of the following: - RSA - SHA256withRSA - SHA512withRSA - SHA3-256withRSA - SHA3-384withRSA - SHA3-512withRSA

Note: If the secret key for signing the data is of the DSA (Digital Signature Algorithm) key type, this service does not support the MD5 signing algorithm. This is applicable only for PGP.

Output Parameters

stream: java.io.OutputStream Conditional. Signed data as an output stream. Returned when the loadAs input parameter is set to stream.

bytes: byte[] Conditional. Signed data as bytes. Returned when the loadAs input parameter is set to bytes.

string: String Conditional. Signed data as a string in the ASCII-armored format. Returned when the loadAs input parameter is set to string.

status: String Indicates whether the data is successfully signed or not. If successful, status is success. Otherwise, status contains failure along with an error message.

Note: Authentication keys in the .ecc format are not supported.

signAndEncrypt

Adds a digital signature to data and then encrypts the data.

Input Parameters

securityProvider: String Optional. The type of security provider. The valid values are:
  • PGP (Pretty Good Privacy)
  • JCE-KBE (Java Cryptography Extension-Key Based Encryption)
  • The default value is PGP.

data: Document Data that you want to sign and encrypt. The data must be in one of the following formats. If multiple input parameters are supplied for data, the service throws an exception stating that only one parameter must be passed. - string: String Optional. The string that you want to sign and encrypt. - stream: java.io.InputStream Optional. The stream data that you want to sign and encrypt. - bytes: byte[] Optional. The byte array that you want to sign and encrypt.

loadAs: String Optional. The format in which the service returns the output. Set to:
  • bytes to return the output as a byte array. This is the default.
  • stream to return the output as a stream object.
  • string to return the output as a string.

publicKey: Document The public key required to encrypt the data.

For PGP, provide publicKeyBytes, publicKeyString.

For JCE-KBE, provide publicKeyBytes, publicKeyString, or truststoreAlias. If you provide truststoreAlias, you must also provide certAlias. Otherwise, the service throws an exception. - publicKeyBytes: Object List Optional. One or more public key files as byte arrays for PGP. JCE supports only a single public key file.

Note:
  • Public key files have a .asc extension for PGP.
  • This parameteris required only when you use truststoreAlias.

encryptionAlgorithm: String The encryption algorithm to use. For PGP, select one of the following symmetric key encryption algorithms: - AES_192 - AES_256 - BLOWFISH - IDEA - TRIPLE_DES - TWOFISH The default value is AES_256.- For JCE, select RSA (asymmetric key encryption algorithm).

secretKey: Document The secret key required to sign the data. For PGP, provide secretKeyBytes, secretKeyString. For JCE-KBE, provide secretKeyBytes, secretKeyString, or keyStoreAlias. If you provide keyStoreAlias, you must provide keyAlias. Otherwise, the service throws an exception. - secretKeyBytes: byte[] Optional. The secret key file in bytes.

Note: Secret key files have a .asc extension for PGP.
  • secretKeyString: String Optional. The secret key as a string.
  • secretKeyPassphrase: String Password required to extract the private key from the secret key. This is the password provided while generating the secret key.
  • keyStoreAlias: String Optional. Applies only to JCE. The keystore alias that contains the private key.
  • keyAlias: String Optional. Applies only to JCE. The private key alias in the keystore specified by the keyStoreAlias parameter.
Note: This parameter is required only when you use keyStoreAlias.

signingAlgorithm: String. The signing algorithm to use.

For PGP, select one of the following:
  • SHA256
  • SHA384
  • SHA512

The default value is SHA256 for PGP.

For JCE, select one of the following:

  • RSA
  • SHA256withRSA
  • SHA512withRSA
  • SHA3-256withRSA
  • SHA3-384withRSA
  • SHA3-512withRSA
cipher: String Optional. Applies only to JCE. The cipher for encryption. Select one of the following:
  • RSA
  • RSA/ECB/PKCS1Padding
  • RSA/ECB/OAEPWithSHA-1AndMGF1Padding
  • RSA/ECB/OAEPWithSHA-256AndMGF1Padding
  • RSA/ECB/OAEPWithSHA-512AndMGF1Padding
  • RSA/ECB/OAEPPadding The default value is RSA.

Output Parameters

stream: java.io.OutputStream Conditional. Signed and encrypted data as an output stream. Returned when the loadAs input parameter is set to stream.

bytes: byte[] Conditional. Signed and encrypted data as bytes. Returned when the loadAs input parameter is set to bytes.

string: String Conditional. Signed and encrypted data as a string in the ASCII-armored format. Returned when the loadAs input parameter is set to string.

status: String Indicates whether the data is successfully signed and encrypted or not. If successful,statusis success. Otherwise,status contains failure along with an error message.

Usage Notes

  • Use the signAndEncrypt service when an external system connected to server requires signed and encrypted data. The service accepts multiple public keys to encrypt the same data for many users.

  • Prerequisites to use the signAndEncrypt service:

    • Make sure that server has access to the external system's public key to encrypt data.
    • Generate a secret key for server to sign the data.
  • Signing and encryption work as follows:

    • The service uses the secret key to sign the data.
    • The service then uses the external system's public key to encrypt the data.
    • The service returns the signed and encrypted data.
  • For PGP, consider the following point:

    • To sign and encrypt the data for multiple users, provide your secret key and the users' public keys to the service. You can provide the public keys to the service as a list of byte arrays, strings.
    • Authentication keys used in this service must be in the PGP format and generated using the RSA encryption algorithm.
Note: Authentication keys in the .ecc format are not supported.
  • For JCE, you can sign and encrypt the data for a single user only.

verify

Verifies signed data.

Input Parameters

securityProvider: String Optional. The type of security provider. The valid values are: - PGP (Pretty Good Privacy) - JCE-KBE (Java Cryptography Extension-Key Based Encryption) The default value is PGP.

data: Document Signed data that you want to verify. The data must be in one of the following formats. If multiple input parameters are supplied for data, the service throws an exception stating that only one parameter must be passed.

  • string: String Optional. The signed string that you want to verify.
  • stream: java.io.InputStream Optional. The signed stream data that you want to verify.
  • bytes: byte[] Optional. The signed byte array that you want to verify.
loadAs: String Optional. The format in which the service returns the output. Set to:
  • bytes to return the output as a byte array. This is the default.
  • stream to return the output as a stream object.
  • string to return the output as a string.

publicKey: Document The signer's public key required to verify the signed data.

For PGP, provide publicKeyBytes, publicKeyString.

For JCE-KBE, provide publicKeyBytes, publicKeyString, or truststoreAlias. If you provide truststoreAlias, you must also provide certAlias. Otherwise, the service throws an exception.

  • publicKeyBytes: Object List Optional. One or more public key files as byte arrays for PGP. JCE supports only a single public key file. >
Note: Public key files have a.asc extension for PGP.
  • publicKeyString: String List Optional. One or more public keys as strings for PGP. JCE supports only a single public key string.
  • truststoreAlias: String Optional. Applies only to JCE. The alias for the truststore containing the public key and certificate.
  • certAlias: String Optional. Applies only to JCE. The alias identifying a particular trusted certificate within a truststore.
Note: This parameter is required only when you use truststoreAlias.

signingAlgorithm: String. The signing algorithm to use. For PGP, select one of the following: - SHA256 - SHA384 - SHA512 The default value is SHA256 for PGP. For JCE, select one of the following: - RSA - SHA256withRSA - SHA512withRSA - SHA3-256withRSA - SHA3-384withRSA - SHA3-512withRSA

actualData: Document Applies only to JCE. The original data that was signed and needs to be verified against the signature to confirm that it hasn't been tampered with. The actualData parameter must be in one of the specified formats. If multiple input parameters are provided for actualData, the service throws an exception indicating that only one parameter should be passed. string: String Optional. The original string that you want to verify. stream: java.io.InputStream Optional. The original stream data that you want to verify. bytes: byte[] Optional. The original byte array that you want to verify.

Output Parameters

stream:java.io.OutputStream Conditional. Verified data as an output stream. Returned when the loadAs input parameter is set to stream.

bytes: byte[] Conditional. Verified data in bytes. Returned when the loadAs input parameter is set to bytes.

string: String Conditional. Verified data as a string. Returned when the loadAs input parameter is set to string.

verified: Boolean Indicates whether the signature associated with the data is valid or not. A value of: - true indicates that the signed data is verified. - false indicates that the signed data is not verified.

status: String Indicates whether the data is successfully verified or not. If successful, status is success. Otherwise, status contains failure along with an error message.

Usage Notes

  • To verify signed data, server must have access to the signer's public key.

  • For PGP, consider the following points:

    • To verify the data for multiple users, provide the users' public keys to the service as a list of byte arrays, strings.
    • The verify service cannot verify a detached signature.
  • Authentication keys used in this service must be in the PGP format and generated using the RSA encryption algorithm.

Note: Authentication keys in the .ecc format are not supported.
  • For JCE, you can verify the data for single user only.

createMessageDigest

Generates a message digest for a given message.

Input Parameters

algorithm: String Name of the algorithm that you want to use to compute the message digest. Must be one of the following: MD5, SHA-1, SHA-256, SHA-384, or SHA-512.

input: byte[] Optional. Message for which you want the digest generated where the message is in the form of a byte array.

Note: If both input and inputAsStream are provided, inputAsStream takes precedence.

inputAsStream: java.io.InputStream Optional. Message for which you want to generate a message digest where the message is in the form of an input stream.

Note: If both input and inputAsStream are provided, inputAsStream takes precedence.

Output Parameters

output: byte[] Conditional. Computed digest in the form of a byte array. output is returned when the input parameter input is provided.

outputAsStream: OutputStream. Conditional. Computed digest in the form of an output stream. outputAsStream is returned when the input parameter inputAsStream is provided.

getCertificateInfo

Retrieves information such as serial number, issuer, and expiration date from a digital certificate.

Input Parameters

certificate: byte[] java.security.cert.X509Certificate The certificate whose information you want to retrieve.

dateFormat: String Optional. The date format to use for the date returned by the notBefore and notAfter fields in the validity output parameter. The value of dateFormat must be a pattern used by java.text.SimpleDateFormat, for example: MM/dd/yyyy . By default, getCertificateInfo service uses a preset date format that returns only the last two digits of the certificate expiration year. This can lead can lead to ambiguity as a certificate that expires in 2109 returns an expiration year of 09, which some systems might treat as 2009.

Output Parameters

info: Document Information from the certificate. - version: java.lang.Number X509 certificate version number. - serialNumber: String Serial number of the certificate. - signature: String Signature algorithm used by the issuer to sign this certificate. - issuer: Document Detailed information about the CA that signed the certificate, such as name, location, and e-mail address. - validity: Document The time period over which the certificate is valid. - notBefore: String First date on which this certificate is valid (for example, 3/15/00 3:36PM). - notAfter: String Last date on which this certificate is notAfter valid (for example, 3/15/00 3:36PM). - subject: Document. Detailed information about the owner of the certificate, such as name, location, and mail address. - subjectPublicKeyAlgorithm: String Encryption algorithm with which the certificate's key is designed to be used (for example, RSA or DSA).

loadPKCS7CertChain

Converts a certificate chain that is in PKCS #7 format to a list of byte arrays.

Input Parameters

certificateChain: byte[] The certificate chain in PKCS #7 format.

Output Parameters

certificates: byte[] List of byte arrays in which each byte[] in the list contains a certificate from certificateChain.

decryptXML

Decrypts the encrypted XML, and returns the XML as either a string or stream object.

Input Parameters

String Optional. Encrypted XML that needs to be decrypted as plain text.

xmldata: String Optional. Encrypted XML that needs to be decrypted as plain text.

xmlStream: InputStream Optional. Encrypted XML in the form of an input stream.

Note: If both xmldata and xmlStream are provided, xmlStream takes precedence; server uses the xmlStream value and returns only decryptedXMLStream.

keyStoreAlias: String Optional. Alias of the keystore that contains the private key used for decryption.

keyAlias: String Optional. Alias of the private key, contained in the keystore specified by the keyStoreAlias parameter, that is used for decryption.

encoding: String Optional. Specifies the encoding to use if the encoding cannot be extracted from the XML. If encoding is not specified in the XML document or in the encoding parameter, server uses UTF-8.

The encoding value must be a valid IANA encoding.

Output Parameters

decryptedXMLData: String Conditional. DecryptedXML data. decryptedXMLData is returned when the input parameter xmldata is provided.

decryptedXMLStream: Object Conditional. A decrypted XML OutputStream object. decryptedXMLStream is returned when the input parameter xmlStream is provided.

Usage Notes

  • There are several prerequisites to using decryptXML:

    • Certificates must be configured for server and the client with which it is exchanging secure XML.
    • The sending, encrypting client must have access to server's public key before the document exchange can occur.
    • The server stores its certificates in keystores and truststores. You must configure a keystore and truststore for server before using the XML encryption services.
  • The decryptXML service works as follows:

    1. The external system sends the XML document encrypted with the server's public key.
    2. The server receives the document and passes it to the XML service.
    3. The server uses the private key member of the key pair to decrypt the XML.
    4. The decrypted XML is returned from the service.
  • If both xmldata and xmlStream are provided, xmlStream takes precedence; server uses the xmlStream value and returns only decryptedXMLStream.

  • keyAlias and keyStoreAlias should either both be provided or both be absent from the input. If no value is provided forthese parameters, server uses the private key/certificate specified for the Decryption Key. If no value is specified for Decryption Key, server uses the SSL Key.

encryptXML

Encrypt an XML document or node in an XML document.

Input Parameters xmldata: String Optional. The XML to be encrypted.

xmlStream: InputStream Optional. Input stream to the XML that needs to be encrypted.

Note: If both xmldata and xmlStream are provided, xmlStream takes precedence.

nodeSelectors: String List XPaths to the node to be encrypted. If the value for this parameter is left empty, no XML will be encrypted.

nsDecls: Document Optional. Mapping of the namespace prefixes to the namespace URIs. The first column contains the prefixes and the second column contains the corresponding URIs.

recipientCert: Byte[] Optional. The certificate containing the public key that will be used to encrypt the XML. If the input parameters recipientCert and recipientID are both provided, recipientCert is used.

contentOnly: Boolean Optional. Indicates whether the XML tags surrounding the content will be encrypted along with the content. Set to: - true to encrypt only the content. - false to encrypt both the tags and the content. This is the default.

algorithm: String Optional. The symmetric key algorithm to use for encryption. Set to: - tripledes-cbc for the algorithm at http://www.w3.org/2001/04/xmlenc#tripledes-cbc This is the default. - aes256-cbc for the algorithm at http://www.w3.org/2001/04/xmlenc#aes256-cbc - aes192-cbc for the algorithm at http://www.w3.org/2001/04/xmlenc#aes192-cbc - aes128-cbc for the algorithm at http://www.w3.org/2001/04/xmlenc#aes128-cbc

Note: If you are using aes256-cbc or aes192-cbc with JVM 1.6, make sure the unlimited policy jar files have been installed.

encryptedKeyAlgorithm: String Optional. The symmetric key that is randomly generated, and then encrypted with the receiver's public key. This encryption uses an asymmetric algorithm if public/private key pairs are being used. Set to: - rsa-1_5 for the algorithm at http://www.w3.org/2001/04/xmlenc#rsa-1_5 This is the default. - rsa-oaep-mgf1p for the algorithm at http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

encoding: String Optional. Specifies the encoding to use if the encoding cannot be extracted from the XML. If encoding is not specified in the XML document orin the encoding parameter, server uses UTF-8. The encoding value must be a valid IANA encoding.

Output Parameters

encryptedXMLData: String Conditional. Encrypted XML data. encryptedXMLData is returned when the input parameter xmldata is provided.

encryptedXMLStream: OutputStream Conditional. Encrypted XML in the form of an OutputSream. encryptedXMLStream is returned when the input parameter xmlStream is provided.

Usage Notes

  • If both xmldata and xmlStream are provided, xmlStream takes precedence.

  • There are several prerequisites to using the pub.security.xml:encryptXML service:

    • Certificates must be configured for server and the client with which it is exchanging encrypted XML.
    • Before an encrypted XML document can be exchanged between server and an external system, the external system must share its public key.
    • Prior to use of encryptXML, server must have access to the partner's public key. Such access is possible through:

      The server certificate mapping (for information, refer to IBM webMethods Integration Server Administrator’s Guide).

      A copy of the partner's X.509 certificate that is available to server.

  • In encryptXML, the certificate/public key is specified through the following input parameters: the public key of the partner application (through recipientCert).

  • Because encryption is a processing-intensive activity, it is recommended to only encrypt the XML nodes requiring protection.

Signing and Encrypting the Same XML Document

You can use both encryption and signing in the same XML document.

  • If you sign and encrypt different XML elements in a document, you can run either signXML or encryptXML first.
  • Typically, if you sign and encrypt the same XML elements in a document, you should sign the elements before encrypting them. That is, invoke signXML before invoking xml:encryptXML.

signXML

Digitally sign an outgoing XML node or document.

Input Parameters

xmldata: String Optional. XML that needs to be signed.

xmlStream: InputStream Optional. Input stream containing the XML that needs to be signed.

Note: If both xmldata and xmlStream are provided, xmlStream takes precedence.

uri: String Optional. URI to the element to be signed. In combination with the nodeSelectors parameter, the uri identifies the nodes to be signed.

noNamespace SchemaLocation: String Optional. A URI that identifies the location of the XML schema definition that contains the ID attribute specified in uri. Provide a noNamespaceSchemaLocation when specifying an ID attribute for uri and the ID attribute resides in an XML schema with no namespaces.

schemaLocations: Document Optional. Document containing name-value pairs forthe XML namespace and the location of the XML schema definition that contains element declarations, attribute declarations, and type definitions for that namespace. Provide a schemaLocation when specifying an ID attribute for uri and the ID attribute resides in an XML schema for a particular namespace.

For example:
XML namespace = http://www.w3schools.com - XML schema
                    definition location = file:C:/note.xsd

nodeSelectors: String List XPath notation that identifies the nodes to be signed. The locations of the XPaths are not absolute, but relative, and work within the context of the node (an XPath Axes).

Note: Do not use absolute location XPaths here.

nsDecls: Document Optional. Mapping of the namespace prefixes to the namespace URIs. The first column contains the prefixes and the second column contains the corresponding URIs.

isEnveloped: String Optional. Indicates whether the signature is enveloped or enveloping. Set to: - True to indicate that the generated signature will be enveloped. This is the default. - False to indicate that the generated signature will be enveloping, provided the isDetached parameteris set to False.

Unlike the detached signature, which is kept apart from the original document, enveloping and enveloped signatures are tightly coupled with the original document.

isDetached: String Optional. Indicates whether the signature is detached or not.

The server uses as the container for signature and the XML to be signed. Set to:
  • True to indicate that the generated signature will be detached.
  • False to indicate that the generated signature will be enveloping or enveloped, based on the isEnveloped parameter setting. This is the default.
Note:
  • Setting isDetached to True and isEnveloped to False, indicates that the signature will be detached.
  • Setting isDetached to False and isEnveloped to True,indicates that the signature will be enveloped.
  • Setting isDetached to False and isEnveloped to False,indicates that the signature will be enveloping.
  • Setting isDetached to True and isEnveloped to True, results in error.
  • SHA1 (default)
  • SHA256
  • SHA384
  • SHA512

includeKeyValue: String Optional. Indicates whether to include the key value (RSAKeyValue or DSAKeyValue), based on the certificate used for signing. The KeyValue element contains a single public key that can be used in validating the signature. Set to: - True to include the key value (RSAKeyValue or DSAKeyValue) based on the certificate used for signing. - False to exclude the key value from the signature.

includeCertChain: String Optional. Indicates whether the certificate chain should be included in the signature. Set to:
  • - True to include the certificate chain in the signature.
  • - False to leave the certificate chain out of the signature. This is the default.

Output Parameters

signedXMLData: String Conditional. Signed XML data. signedXMLData is returned when xmlData is provided.

signedXMLStream: OutputStream Conditional. Signed XML in the form of an OutputSream. signedXMLStream is returned when xmlStream is provided.

Usage Notes

  • Before the signing/signature verification of XML can occur between server and an external system, the server must share the public key that corresponds to the private key with which the document is signed. The server must share the public key with the external system that will be performing verification.

  • keyAlias and keyStoreAlias should either both be provided or both be absent from the input. If no value is provided forthese parameters, the server uses the private key/certificate specified for the Signing Key. If the Signing Key is not specified, server uses the SSL Key.

  • If both xmldata and xmlStream are provided, xmlStream takes precedence.

  • The uri and nodeSelectors parameters identify the nodes to be signed.

  • If uri is specified and nodeSelectorsis not specified, server signs the entire node identified by uri.

  • If uri and nodeSelectors are specified, server determines which nodes to sign by locating the node specified by the uri and then applying the filter from nodeSelectors.

  • If uri is not specified and nodeSelectors is specified, server determines which nodes to sign by applying the filter in nodeSelectors to the entire XML.

  • If neither uri nor nodeSelectors are specified, server signs the entire XML.

  • You can use the value of an ID attribute as the uri. For example, #sampleID.

  • Where sampleID is an ID attribute that functions as a unique identifier for an element in an XML schema definition. In this example, the server will locate the node with the ID attribute "sampleID" and then apply the filter specified by nodeSelectors to determine which nodes to sign.

Signature Types

As opposed to a detached signature, which is kept apart from the original document, enveloping and enveloped signatures are tightly coupled with the original document.

An enveloping signature must be a parent node of the data being signed:
<!--
                    Example of Enveloping Signature --> <Signature> <my_document>. .
                    . </my_document> </Signature>\
The following input parameters and values are applicable only to enveloping signatures:
isEnveloped: Specify a value of "false" for
                    enveloping.
If isEnveloped is set to false, then:
  • - If both uri and idXmlObject are null, the server creates a dynamic unique value for both uri and idXmlObject and signs the XML.
  • - If idXmlObject is provided and uri is null, the server creates a uri with a value of #idXmlObject_value and signs the XML.
  • - If both and uri and idXmlObject are provided and match the XML contract (for example,uri='#idXmlObject'), The server signs the XML. If the uri and idXmlObject parameters do not match the contract, the server issues an exception.
idXmlObject: Specifies the ID for the node that holds the original, signed XML. An enveloped signature must be a child node of the data being signed:
<!--
                    Example of Enveloped Signature --> <my_document><Signature> . . .
                    </Signature> </my_document>
The following parameters and values are applicable only to enveloped signatures: isEnveloped: The default value of "true" specifies that the signature is enveloped. signatureNodeSelector: XPath to the node where the signature is entered. If no value is provided, the signature is placed as a first child of the root node.

Signing and Encrypting the Same XML Document

You can use both encryption and signing in the same XML document.
  • If you sign and encrypt different XML elements in a document, you can run either signXML or encryptXML first.

  • Typically, if you sign and encrypt the same XML elements in a document, you should sign the elements before encrypting them. That is, invoke signXML before invoking encryptXML

getKeyAndChain

Returns a private key and its associated certificate chain from a designated keystore.

Input Parameters

keyStoreAlias: String Alias for the keystore that contains the private key of interest and its certificate.

keyAlias: String Alias for the private key stored in the specified keystore.

Output Parameters

privateKey: java.security.PrivateKey Object representing the private key.

certChain: byte[] [] List of byte arrays representing the certificate chain associated with the private key.