Getting Started with Scripting

 Beginning version 1.1.9 WCFStorm now supports scripting using IronPython.  Scripting can used from the console or from the GUI.

Scripting from the GUI

1. Add a service or open a project to enable scripting

2. If there are no errors from step 1 above, the scripting menu button  will be enabled.  Clicking it will open the the scripting window shown below.  By default it will show a python script for making consecutive calls to 2 wcf service methods.

The script windows features the following

  • A simple python editor with syntax highlighting.
  • It allows you to execute the script by pressing F5 or by clicking on the Run menu button
  • It allows you to abort the execution of a running script.
  • It allows you to save open and save a script file.
  • It allows you to add the script into the main service tree in the main window.  This is especially useful when working with projects because this will allow the saving of scripts as part of the project.

IronPython Editor

3.  If a script is added into the main service windows, it can be executed directly from by right-clicking and selecting Run from the context

Script Context menu

 

Important Technical Notes:

  1. Each script run in its own scope and is executed in a separate thread
  2. A "task" variable is added to the runtime.  This variable contains methods for invoking a WCF method, executing a test case, etc.  To get the exact list of functions, type "task." and press Ctrl-Space to open up intellisense window.

    Methods of the "task" variable
     
  3. The following folders are added into the search path.

    a. The .NET Framework folder
    b. {wcfstorm.exe path}/Scripting.  If the Scripting subfolder does not exist, it will be created automatically
    c. The content of the "IRONPYTHON" environment variable.

Site Map | Printable View | © 2008 - 2024 WCFStorm Solutions

Powered by mojoPortal | XHTML 1.0 | CSS | Design by styleshout