Add Security to a Web Service Script

This task describes how to add set the security for your Web Service calls. For details about Web Services security, see Setting Security Overview.

  1. Insert a new Web Services Security Step

    1. Place the cursor at the point at which you want to add the security settings. In most cases, it is best to place it in vuser_init so that the security scope will be applied to the whole script. To apply the security for specific calls, place it at the desired location.

    2. Right-click and select Insert > New Step. In the Steps Toolbox, under the Web Services functions, double-clickweb_service_set_security. The Set Security Properties box opens.

  2. Add a security token - optional

    1. Click Security Tokens and select a token type. For details, see Security Tokens and Encryption.

    2. In the Token Name box, assign a name for the token to be used by VuGen in identifying the token.

      Add any relevant information, such as User Name and Password for the UserName token type.

  3. Add a message signature or encryption - optional

    1. On the Set Security Properties box toolbar, click Add Message Signature or Add Message Encryption.

    2. In the Signing/Encryption token box, select a token to use with the message signature or encryption. Both signatures and encryptions require you to specify a token previously defined as the signing/encrypting token. See Add a security token - optional above.

    3. Under What to sign, specify a target token, or leave the field blank to apply the signature or encryption to the whole message body. For details, see Security Tokens and Encryption.

  4. Cancel the security settings - optional

    To cancel the security settings at a specific point within the script, add a web_service_cancel_security step at the desired point.

See also: