To debug plug-in scripting we first need to understand what plug-in scripting is, what software we need, and the setup steps.
Plug-in scripting is the Verivo name for a scripting layer that sits in the plug-in directory of the AppServer. It uses Iron Python which gives you the ability to call .Net objects with python language syntax. It has a number of injection points where you can access requests and responses. Currently plug-in scripting only exists for web service calls (WSDL and REST plug-ins). The following calls are exposed:
- Used for any custom authentication setups. It is called when you first log in to the app and on any custom authentication screens.
- Holds all the information being passed to the plug-in. It consists of several instruction groups that hold the SELECT, WHERE, ADD etc. commands.
- Holds the information after being processed by the plug-in, but before being sent to the back end data source. For WSDL this is an array of complex objects, for REST it is XML.
- The exact response that comes back from the web service. For WSDL this is an array of complex objects, for REST it is XML.
- Verivo software needs information to be in a table. This method takes the information from the HandleRawResponse and formats it into a DataTable object.
- A complex object that the plug-in will return to the device. Similar to DataRequest it has all the information being sent.
The software tools needed are:
- Microsoft Visual Studio 2010 shell (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=115). Earlier version of Visual Studio will not work as plug-in scripting takes advantage of .Net 4.0 objects.
- PythonToolsInstaller (http://pytools.codeplex.com/).
- You need to add the following line to your web.config file:
<add key="Plug-inScriptDebugging" value="True" />
At this point you have a python file written that you want to troubleshoot and the necessary files installed. The last major piece is the actual debugging.
Use the following procedure to debug your code:
- Have Visual Studio running on the AppServer.
- Open the python file with Visual Studio.
- Go to Tools -> Attach to Process.