Service signature for calling an integration

A signature is an agreement between webMethods B2B Integration and webMethods Integration or any external call. After you call an integration on webMethods Integration or through an external call, webMethods B2B Integration receives the results of the service execution. webMethods B2B Integration displays the information in the form of tasks in Reliable execution mode and as an entry in the Course of transaction section of the corresponding transaction.

Input request

metadata
Document. Metadata is a composite object that contains the following fields:
sender
String. Name of the recognized sender.
receiver
String. Name of the recognized receiver.
documentType
String. Name of the recognized business document.
documentId
String. Internal ID extracted as a transaction attribute.
userStatus
String. Status that you or a partner assign to a document (for example, Needs Approval).
groupId
String. Identifier that associates a transaction with other transactions in a group.
conversationId
String. Identifier that associates a transaction with other business transactions.
attributes
Document. Key-value pairs of all extracted attributes of the transaction (key is attribute name, and value is attribute value). For example, cost, tracking Id, $duplicate.
Important: Attribute name is case-sensitive.

Prevent spurious execution of an integration by using the $duplicate attribute in the attributes list. Based on the value of the $duplicate attribute, you can choose to run the integration again or ignore it. The document is identified as duplicate when the value is set as true. The default value is false.

request
Document. A request message is a composite object that contains the following fields:
largeDoc
Boolean. For large documents, the value of the largeDoc is true and the content is null.
content
String. Content of the document that is encoded in Base64. The content is null for large document.
contentPartNames
String List. The list of all the names of content parts in the specified transaction.
Note: This field can be used in getTransactionContentParts operation to get the content parts of the associated contentPartNames.
type
String. Type of content sent. The following codes pertain to the file type of the inbound document:
  • 0 - If the business document type does not recognize the content, it is tagged as Unknown.
  • 1 - If the content is identified as XML-family type.
  • 2 - If the content is identified as Flat File-family type.
  • 3 - If the content is identified as EDI-family type.
  • 4 - If the content does not belong to any of the listed types.
encoding
String. The type of encoding used to encode the content in the request message.

The content is encoded in the UTF-8 standard. You cannot alter this standard.

attachments
Document List. (Optional) List of attachments that are sent as part of integration response.
header
Document. (Optional) Headers sent as part of the integration response.

Output response

The output that is received from webMethods Integration or from an external call must adhere to the following output signature:

error
Document. Error is a composite object that contains the following fields:
code
String. Error code received.
message
String. Error message associated with the error code.
response
Document. The response message is a composite object that contains the following fields:
content
String. Content of the document that is encoded in Base64.
type
String. Type of content sent.
encoding
String. Type of encoding that was used to encode the content in the response message.

If the response does not contain the encoding method, webMethods B2B Integration considers the content to be using Base64 encoding in the UTF-8 standard.

attachments
Document. List of attachments received from the input parameter attachments.
header
Document. Headers received from the input parameter header.

webMethods B2B Integration displays appropriate information, based on the response that is received from webMethods Integration or an external call after the service runs. To interpret the status of the transaction, use the setHTTPResponse flow function in webMethods Integration to set the HTTP status code for webMethods B2B Integration.

The response can be one of the following objects (error or response):

response
HTTP status code range for success scenarios is 200-299.
error
Use an appropriate HTTP status code to indicate how the error is interpreted in webMethods B2B Integration by using the setHTTPResponse flow function. For example, if you are accessing an unauthorized resource, use HTTP status code 401 for webMethods B2B Integration to interpret it as an unauthorized request.

Example of request payload

Example of the flow service request during the Call an Integration action in the processing rule, for an XML payload.

{
"metadata": {
  "sender": "Acme Corporation",
  "receiver": "IBM",
  "documentType": "PurchaseOrderRequest",
  "documentId": "53o5dn00ec9rmuok00000070",
  "userStatus": "IGNORED",
  "groupId": null,
  "conversationID": null,
  "attributes": {
     "country": "UNITED STATES"
  }
},

 "request": {
  "largeDoc": false,	
  "content": "<encoded content>",
  "type": "1",
  "encoding": "UTF8",
  "contentPartNames": [
     "xmldata"
  ]
   }
}

Note: For an EDI payload, the conversationID and GroupID are populated with values.

Example of response payload

{
   "response": {
      "content": "<encoded content>",
      "type": "text",
      "encoding": "UTF-8"
   }
}

Example of the flow service response to signal execution failure.

{
    "error": {
        "code": "USER_STATUS_FAILED",
        "message": "Failed to update user status for transaction 53o5dn00ec9rmuok00000070"
    }
}