Post Web Data Action

image\Action_Launch_Post_Web.jpg

The Post Web Data action allows you to send and/or receive data from a remote Server – information is sent or received using variables. In other words, you can send and receive information across the Internet. For example, you could send quiz score results from your publication to a Server; so all results from tests could be centrally stored. Alternatively, you could receive data from a Server into your publication, such as the latest price list, which means you don’t have to republish a new version of your publication every time prices are changed.

Note:
This action is used when you intend to publish to HTML5 or use Opus Flex. This action and the Database actions are the only ways in which you can send and receive information over the web in Opus as you are not allowed to create or read information in text files over the web for security reasons.

Setting up the Post Web Data action:

  1. Add the Post Web Data action to your trigger, as described in adding actions. The Post Web Data tab will automatically appear when you add the action.

  2. Click inside the URL box and type the URL that you want to send data to or receive data from.

Note:

The URL is the address on a remote server that the information will be sent to or received from. Normally, this will be a cgi-script that will process the data. These scripts are normally saved in a subfolder, which is often named cgi-bin. The URL will look similar to this example:

  http://www.digitalworkshop.com/cgi-bin/results.pl

  1. Check the Secure (Use HTTPS) option if you want the post action to use a secure encrypted communication.

Note:
The server must support HTTPS and have a valid certificate to use secure mode – you cannot simply check this option for any web server. The post action will fail if the server does not support HTTPS or the certificate is invalid..

  1. Use the Source tab to SEND data from Opus to the remote Server.

Note:
Clicking on the Source tab will show the options you can set when sending information to the Server – these options are described from point 5 onwards.

  1. Use the Destination tab to RECEIVE data from a remote Server into an Opus publication.

Note:
Clicking on the Destination tab will show the options you can set when receiving information from the server – these options are described from point 5 onwards.

  1. The following options appear in both the Source and Destination tab – the Source options affect how information is sent to the Server while the Destination options affect how the information is received from the Server.

Note:
This action allows you to both send and receive information at the same time. Alternatively, you can just send or receive information.

  1. Use the None option if you do not want to send or receive information. Click None in the Source tab if you do not want to send information to the Server. Click None in the Destination tab if you do not want to receive information from the Server.

Note:
If None is selected in both the Source and Destination tab then nothing will happen at all. Often you will want to send or receive data but not do both at the same time, so one of the tabs will probably be set to None.

  1. Use the Variable option if you want to send or receive one single bit of information. Click on the down arrow to the right of the Variable option to select the name of the variable in which you want to store the information received or contains the information you want to send. If you have not yet created the variable, then click on the New button to open the New Variable dialog.

 In the Source tab select the variable that contains the information you want to send. The variable can be any of the system or user-defined variables.

 In the Destination tab select the variable in which the received data should be stored. The variable can be any of the system or user-defined variables.

 When you send this information to a Server, the contents of the variable are sent to the server with the string name data. Therefore, the cgi-script that processes the data should be looking for the name data – see Using Name-Value Pairs in the Post Web Data action for more information.

  1. Use the Multiple Fields option when you want to send more than one bit of information to a remote server, or receive more than one bit of information from a server. Click on the Add button to add a new entry. You add two bits of information for each entry you make: the String name (the cgi-script name for the variable); and the Variable name (the Opus variable in which the value is stored in or saved to).

Note:
The Multiple Fields option uses name-value pair information to send and receive data. Please read the topic Using Name-Value Pairs in the Post Web Data action for more information.

  1. Click on the Apply button to save your changes.

Related Topics:

Choosing an Action

Using Name-Value Pairs in Post Web Data