Set the HTTP header - for authentication

Besides username and password, the endpoint system (Service Anywhere) also requires cookie in the request header to perform authentication. The Javascript function below has the following purposes:

  • Set cookie to the header for inbound requests
  • Set additional ‘Content-type’ into the header for outbound requests

Out-of-box function:

CaseExchange_SAWUtil.getHttpHeader

The function has the following parameters:

  • direction: The direction of the action. This parameter has only two values:

    • lib.smis_Constants.MAPPING_DIRECTION_LEFTRIGHT()
    • lib.smis_Constants.MAPPING_DIRECTION_RIGHTLEFT()

    You can call the lib.CaseExchange_CommonLib.isOutbound(direction) or lib.CaseExchange_CommonLib.isInbound(direction) function to judge if the action is inbound or outbound.

  • param: All parameters defined in the SMIS configuration. You can get a specific parameter value by using the param['object'] syntax. If you change any value in this parameter, the change is saved to the SMIS configuration.

The function returns the following result:

Object: The HTTP Header object