Knowledge Base

Search the Knowledge Base: |
Search the Knowledge Base: |
Using the VIPerl Toolkit Web Services Debug Utility
Details
Solution
This KB describes how to use the VIPerl Toolkit debug utility. This utility is provided to help developers identify potential errors in their Web services SOAP messages.
To use VIPerl Toolkit debug utility:
1. Install VI Perl Toolkit. Refer the following link for information on installing the VI Perl Toolkit:
http://www.vmware.com/support/developer/viperltoolkit/doc/perl_toolkit_install_idx.html
2. Copy the script debugutility.pl to your VI Perl Toolkit directory. For example:
C:\Program Files\VMware\VMware VI Perl Toolkit\Perl\samples
3. Open the debugtility.pl file using a text editor.
4. Add your source code to the debugutility.pl file.
Place your source code within the designated eval function. The designated area is highlighted with comment text as follows:
eval {
## Insert your code here - after eval { and before end of eval ie. };########
###### End of Code Inserted ###################################
};
5. Save and close the debugutility.pl file.
When you execute the utility, you provide any parameters required to run this code at the command prompt. The command line arguments are then parsed to generate a dynamic hash map.
6. Navigate to C:\Program Files\VMware\VMware VI Perl Toolkit\Perl\samples .
7. Open a command prompt and enter the following:
> perl debugutility.pl --username <user> --password <mypassword>
--url https://<ipaddress>:<port>/sdk/webService
--sampleParam1 <Value> --sampleParamN <Value>
where – sampleParams are any parameters the code you inserted in the blank eval function requires to run.
Sample Test Cases
|
Setup |
Command |
Result |
|
Test Case P_debugutility_1 | ||
|
Run the debug utility, without your source code inserted, while connected to an ESX Server. |
perl debugutility.pl --username administrator --password mypassword --url https://<ipaddress>:<port>/sdk/webService |
The debug utility displays the environment information of the host: · Host Name · Host Version · Devices connected to the host. · List of virtual machines and the guest os running on each virtual machine. The information is saved in a system information file. |
|
Test Case P_debugutility_2 | ||
|
Run the debug utility, without your source code inserted, while connected to a VirtualCenter server. |
perl debugutility.pl --username administrator --password mypassword --url https://<ipaddress>:<port>/sdk/webService |
The debug utility displays: · Number of hosts connected to the VirtualCenter server. · VirtualCenter version · The environment information of all the hosts o Host Name o Host Version o Devices connected to the host o List of virtual machines and the guest os running on each virtual machine The information is saved in a system information file. |
|
Test Case P_debugutility_3 | ||
|
Run the debug utility, with your source code inserted in the designated blank eval function. All the parameters needed for executing the inserted code need to be provided at the command prompt. If no exception is generated by the function, the utility stops upon completing the execution. |
perl debugutility.pl --username administrator --password mypassword --url https://<ipaddress>:<port>/sdk/webService --sampleparam dummy1 --sampleparam2 dummy2 |
The debug utility: · Executes the inserted code. · Displays and saves all the environment information in a system information file. · Displays a message "Code executed successfully". |
|
Test Case P_debugutility_4 | ||
|
Run the debug utility, with your source code inserted, on an ESX Server. All the parameters needed for executing the inserted code need to be provided at the command prompt. An exception is generated by the function, and the utility handles the exception |
perl debugutility.pl --username administrator --password mypassword --url https://<ipaddress>:<port>/sdk/webService --sampleparam dummy1 --sampleparam2 dummy2 |
Whenever an exception is encountered, the debug utility performs the following: · Displays and saves all the environment information in a system information file. · Displays the exception encountered. · Records the last log line for the connected hosts and extracts the modified log content upon execution of the blank eval function. For each connected host, a log is saved as <hostname>.log. · Generates log bundles and saves them as "logbundles" files. |
|
Test Case P_debugutility_5 | ||
|
Run the debug utility, with your source code inserted, on a VirtualCenter server. All the parameters needed for executing the inserted code need to be provided at the command prompt. If no exception is generated by the function, the utility stops upon completing the execution. |
perl debugutility.pl --username administrator --password mypassword --url https://<ipaddress>:<port>/sdk/webService |
Whenever an exception is encountered, the debug utility performs the following: · Displays and saves all the environment information in a system information file. · Displays the exception encountered. · Records the last log line for the connected hosts and extracts the modified log content upon execution of the blank eval function. For each connected host, a log is saved as <hostname>.log. · Generates log bundles and saves them as "logbundles" files. |
|
Test Case P_debugutility_6 | ||
|
Run the debug utility, with your source code inserted, on a VirtualCenter server. All the parameters needed for executing the inserted code need to be provided at the command prompt. If the utility is interrupted by user or the inserted code creates an infinite behavior. The utility handles the error as an exception. |
perl debugutility.pl --username administrator --password mypassword --url https://<ipaddress>:<port>/sdk/webService |
Whenever an exception is encountered, the debug utility performs the following: · Displays and saves all the environment information in a system information file. · Displays the exception encountered. · Records the last log line for the connected hosts and extracts the modified log content upon execution of the blank eval function. For each connected host, a log is saved as <hostname>.log. · Generates log bundles and saves them as "logbundles" files. |
|
Test Case N_debugutility_1 | ||
|
Run the debug utility, with your source code inserted, on a VirtualCenter server. Do not provide all the parameters needed for executing the inserted code. A fault is generated. The utility handles error as an exception. |
perl debugutility.pl --username administrator --password mypassword --url https://<ipaddress>:<port>/sdk/webService |
Whenever an exception is encountered, the debug utility performs the following: · Displays and saves all the environment information in a system information file. · Displays the exception encountered. · Records the last log line for the connected hosts and extracts the modified log content upon execution of the blank eval function. For each connected host, a log is saved as <hostname>.log. · Generates log bundles and saves them as "logbundles" files. |
|
Test Case N_debugutility_2 | ||
|
Run the debug utility, with your source code inserted, on a VirtualCenter server. Do not precede all parameters needed for executing the inserted code with a dash (-) or double-dash (--). The parameters missing the dash or double-dash are not recognized as parameters. They are not available for the inserted code through the get-option. If the parameters are required to complete the execution of the inserted code, a fault is generated. The utility handles the error as an exception. |
perl debugutility.pl --username administrator --password mypassword --url https://<ipaddress>:<port>/sdk/webService -sampleparam1 dummy1 sampleparam2 dummy2 |
Whenever an exception is encountered, the debug utility performs the following: · Displays and saves all the environment information in a system information file. · Displays the exception encountered. · Records the last log line for the connected hosts and extracts the modified log content upon execution of the blank eval function. For each connected host, a log is saved as <hostname>.log. · Generates log bundles and saves them as "logbundles" files. |
Keywords
Attachments
Feedback
- KB Article: 1002830
- Updated: Aug 14, 2009
- Products:
VMware Infrastructure SDK - Product Versions:
VMware Infrastructure SDK 2.0.x

