Workflow Task Type: Web Service - SOAP Message

From SmartWiki
Revision as of 12:17, 17 June 2015 by Cameron (talk | contribs)

Jump to: navigation, search

The Web Service - SOAP Message Workflow Task allows you to post data to another system, outside of SmartSimple. The response returned by the external system can be stored into a custom field on the object against which the Workflow was triggered.

WorkflowTaskTypeSettings-SOAP.png

Task Settings

Request for Approval Tasks have the following settings:

  • Name - Narrative name for the task.
  • Task Number - A system generated number that determines the presentation order of the task in the workflow. This number can be changed to display the step in a different location.
  • Description - Detailed description of the task (optional).
  • Expire After - Intended duration of the workflow.

Message Template

  • Action: The action to called by the Web Service call (These actions are defined by the external server, and are not part of SmartSimple)
  • Custom Field ID for Response: The Custom Field ID of an XML custom field on the object that the Workflow was triggered against that the response returned by the external server.
  • Email Message Header - The email header can be modified using the following syntax, with the arguments separated by semicolon:
  • X-Priority={1,2,3,4,5}
  • Priority={normal,urgent,non-urgent}
  • Importance={high,normal,low}
  • Sensitivity={personal,private,company,confidential}
e.g. Priority=urgent;Importance=high
  • Endpoint: The URL or IP address of the destination server
  • Envelope Template: The content of the Web Service message to be sent to the external service. This can contain variables related to the object the workflow is triggered against.
  • Attach Object - Attaches the details of the object to the message. In the case of a SmartSimple object, such as a company, person, or application, the textual details of the object will be added. If the object is a file, then the file will be attached to an e-mail message, but not an instant message.
  • Attachment File IDs - Attach additional default files when triggered from a Smart Folder. See the Determining the File ID article for instructions.
  • Save as Event - Email will be saved as an event.

Example of SOAP Message Template Configuration

SOAP.png

Important

If the content from the custom fields being included within the SOAP message contains certain special characters it will disrupt the XML structure, making the message unreadable by the receiving server. The less than symbol (<) and ampersand (&) are two primary special characters to be concerned about. When including fields that may contain those characters you should use a special wrapper so the receiving understands that they are data content and not part of the XML structure:

<![CDATA[ CONTENTS ]]>

For example, an address could contain ampersands, so should be included as:

<primarycontact>
 <firstname>@firstname@</firstname>
 <lastname>@lastname@</lastname>
 <address><![CDATA[@address@]]></address>
</primarycontact>
  • It is advisable to use CDATA for any field containing text since the contents are often unpredictable.
  • It is also possible to sanitize the field data at the point of entry (i.e. using JavaScript Validation, depending on how it is entered).

Note

If the response to your Web Service call contains values that you wish to store within a Custom Field on the object against which the Workflow was triggered you can connect a Update Custom Field Value Workflow Task to be the task following the Web Service - SOAP Message and use the variable syntax to pull the value from the XML Custom Field you selected to store the response to the Web Service call.

For example, if the XML Custom Field that stores the response (custom field ID 155255 in the image above) is called Web Service Response, the variable in the Update Custom Field Value task to pull a node called AssignedIdentifier could be:

@xml.Web Service Response.soap:Body.AssignedIdentifier.nodevalue@

If the response should be saved to a System Variable, the syntax would be:

@system.xml.fieldname.nodename.nodevalue@

See Also