Wiki

Scale Your Enterprise

User Tools

Site Tools

mbstring extension must be loaded in order to run mPDF

bw:web_service_tool

This is an old revision of the document!


Introduction (WebService Tool)

The Web Services tool is used to allow Bizweaver to interact with APIs from other applications. Bizweaver also has its own API in the form of the Bizweaver web service. Unfortunately, almost all APIs are different. This document describes how the Web Service tool is configured and provides some basic examples of how it is used for some major applications.

Audience

This document is intended for developers of Bizweaver workflows.

Related Documents

The following documents contain additional information that may be helpful with the development of Bizweaver workflows.

Special Terminology

Beginning in Bizweaver v2.0.170, two Web Service tools are displayed: WebService and WebService2. WebService2 provides a much more flexible way of working with web services including the use of REST Global Connections While workflows created using WebService will continue to function, any new workflows should use WebService 2. All references to “WebService” in this section refer to WebService2.

  • API – Application Programming Interface. Technical tools to allow one application to interact with another, typically via “internet-type” methods.
  • REST - “REST” stands for REpresentational State Transfer. A RESTful API is an application program interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. REST technology is generally preferred to the more robust Simple Object Access Protocol (SOAP) technology because REST leverages less bandwidth, making it more suitable for internet usage. SOAP APIs are not supported in Bizweaver.

Before You Begin

Before you begin to configure a web service tool you will need information from the provider of your target API to know exactly what type of authorization will be used, what needs to be transmitted, and where (e.g. Body, Header, Cookies), and what will be returned.

  1. The web service tool currently has two ways to work with known REST connections.
  2. The Select Service drop-down currently has two options: Custom and Salesforce.com.
    1. Custom is used for all cases other than Salesforce.com
    2. The Salesforce.com option provides a predefined tool specifically for working with Salesforce.com. See Salesforce API for more information on this tool.
    3. Additional predefined tools may be added in the future.
  3. When basic or oAuth 2 authentication is used, a REST Global Connection can be defined. This allows the use of the same information to be used for each call to the target system. In these cases, select the Custom as the Service, check the “Authentication Required” checkbox, and select the (previously defined) Global Connection from the “Select Service” drop-down.
  4. When the connection does not fit any of the above scenarios, leave the service as Custom and the “Authentication Required” checkbox blank.
    1. This will be the case for Bizweaver Web Service.

WebService Tool

There are two main tabs associated with the actual web service call: Request Settings and Response.

Request Settings

The values on the Request Settings tab are used to initiate communication with the API. The values and structures used will vary by API.

  1. The Construct URI text area is where the basic web service call is defined.
    1. Sample URIs and variables for web services commonly used with Bizweaver are provided in the Specific APIs section that follows below.
    2. The basic URI string can also be defined as a variable and then referenced using the <F4> option and adding additional qualifiers as needed.

As an example, here is the base URI to use the HANA Service Layer web services.

https://YourServer:50000/b1s/v1

Instead of entering this string for each web service call we can optionally define the string as a variable.

WebService Variable

Then, in the web service tool, we can reference the variable followed by the specific function we need to use. In the following image we are calling the Login function.

WebService Variable Usage

  1. Each web service all must indicate the Method to be used. Select the appropriate method from the drop-down list.

WebService Methods

  1. Content is used to indicate the media type of the resource. Common content types in the Bizweaver environment include “application/XML” and “application/JSON.”
  2. The Advanced Settings area contains three tabs: Body Information, Header Information, and Cookies. As always, refer to the API document for information about what you need to send in the request and where it needs to be placed.
  3. The Body Information tab offers two additional options: Raw and Form-Data.
  4. The Raw option allows “free form” entry of whatever information is needed as illustrated below.

WebService Advanced

  1. The Form-Data option allows the use of an external file that contains the needed information. This can be helpful when you have multiple web service calls that use the same information.

WebService FormData

  1. The Header Information and Cookies tabs are free-form text and are used as needed by the API.
  2. There are three remaining options on in the Request Information tab.

WebService Other Options

  1. Ignore self signed certificate errors allows communication with sites that use self-signed SSL certificates. If the response to your request indicates a certificate error, try selecting this option.
  2. Format Variables for JSON is used when Bizweaver variables are used in the web service call. Selecting this option ensures that the data passed through the call are formatted correctly. This only applies if the Content type is JSON.
    1. The Timeout value is used as a built-in “pause” mechanism. It causes this step to wait for a response from the called web service. The timeout value is only applied if a response is not received within the set time.
    2. Use the File/Binary Data – Destination option when the expected response is a file containing binary data. This option defines where the response file should be placed.

Examples

  • If the called web service responds in two seconds, the workflow moves to the next step.
  • If the called web service does not respond within the set number of seconds, the workflow will continue to the next step. However, this may cause other issues if the subsequent steps rely on the web service call having completed.

If you have multiple web service call that can execute concurrently (at the same time), set the timeout value to 1.

Once the request information has been provided, click the Request link in the lower right corner of the screen. This will initiate a web service call to the target API based on the information provided. The screen will automatically shift to the Response tab so that you can review the results of the call.

Response

There are five tabs on the Response page: Content, Headers, Cookies, Details, and Log.

  1. Content displays the full content of the response.
  2. Headers displays information returned in the header of the response.
  3. Cookies displays any cookies that are included in the response.
    1. Not all APIs will return cookies.
    2. If the target application uses cookies for authentication in subsequent requests, the cookies from the response can be referenced using Bizweaver step variables.
  4. Details displays detailed information returned from the call.
  5. Log displays the information that was sent in the call.

Images are not provided for these tabs since the information will be different for each API and the call being made.

In all steps in this document you should always refer to the API documentation for the information that you need.

Specific APIs

bw/web_service_tool.1552054845.txt.gz · Last modified: 2019/03/08 09:20 by runger