External System Servlet

The External System Servlet allows the emulation of an HTTP POST to an external system. A test External System can be created that would use the URL in the HTTP section to refer to the External System Servlet on the same application server instance.

Although the final External System may use a different transport protocol – SOAP or HTTP – the main objective for this tool is to validate the XML message content which can be exactly the same for all methods and so the HTTP POST emulation should be useful in most cases.

Note: If the requirement is to see SOAP Envelope content then this would not be possible with the servlet and another method would be needed.

The servlet supports the forwarding or saving of the XML to the following:-

  • Email address
  • File system file
  • Message Center
  • HTTP (essentially only allows logging)

The processing for each option is controlled by URL parameters, defined below, that are specified on the URL used for the HTTP section in the External System.

External System URL Parameters

Parameter Name Description
forwardingProtocol

(optional) Controls the choice of where the XML should be forwarded or saved as a file. If it is present it must be one of the following values:

  • email
  • http
  • messagecenter

Depending on the option chosen other URL parameters may be required (see sections below).

If it is not present, the XML will be saved as a file on the targeted server in the 'Integration Temporary Directory' (see glog.integration.tempdir property in the General Properties appendix).

logOn

(optional)

0 – Default. Do not output URL parameters to log file.

1 – Output all URL parameters to a file in Integration temp dir. The file name of the file will be "ExternalSystemServletLog<N>.txt". The <N> is between 0 and 6 corresponding to each day of the week. There are up to 7 of these files. The oldest file is overwritten each day.

logContent

(optional)

0 – Default. Do not log XML content to log file.

1 – Output XML to log file (name/location described above).

remoteFileExt (optional) If a file is to be saved this file extension should be used otherwise it will have no extension. This property is also available when the forwardingProtocol is not specified which results in the file being saved on the server. See forwardingProtocol above for details.

The following sections describe the additional URL parameters used when a forwardingProtocol is specified.

email

  • from: Valid email address the mail should appear to be sent from.
  • to: Valid email address the mail should be sent to.
  • smtphost: The SMTP server that will be used to transport the message. If not specified the default server will be used.
  • subject: Subject to appear on email.

http

This option essentially acts as the "do nothing" option other than provide logging capability via the logOn and logContent parameters.

messagecenter

When sent as a Message Center message, the event will be sent as a GC3 ALERT event and the XML content is sent as the event message content.

  • to: Valid Transportation and Global Trade Management Cloud user account the message should be sent to.
  • subject: Subject to appear on the message.

Example

Email:

http://< hostname_of_OTM_server>/GC3/glog.integration.servlet.ExternalSystemServlet?
forwardingProtocol=email&smtphost=internal-smtp.hostname.com&from=admin@example.com& to=target@example.com& subject=TestMessage&logOn=0&logContent=0