Readme for .NET (DotNet) Samples
VMware vSphere Web Services SDK Readme
Readme for Java samples
|
This document includes these topics:
This document contains summary information only. See the Developers Setup Guide (Chapter 3, Setting Up for Microsoft C# Development) for complete information.
|
| Note: Information in this document may not be current. For up-to-date information, check these VMware Web sites: |
|
|
|
Building the Samples
You can build the C# (.NET) samples using Microsoft Visual C# 2005 Express or Microsoft Visual Studio 2005. (Visual Studio 2003 is neither recommended nor supported, due to a performance issue. See Knowledge Base article 87402 (.NET Takes a Long Time to Instantiate the VimService Class) for a discussion of the issue.)
Building the Samples Using Visual Studio 2005
- Open a Visual Studio .NET command prompt from the Windows Start Menu:
- Select Start Menu > All Programs > Visual Studio .NET > Visual Studio .NET Tools > Visual Studio .NET Command Prompt
-
Navigate to the SDK\samples\DotNet sub-directory.
- Execute Build2005.cmd by entering the filename on the command line.
Building the Samples Using Visual C# 2005 Express
Select the default (Full) Microsoft Visual C# 2005 Express installation.
If your Microsoft Visual C# 2005 Express installation has not been configured using default locations, you must:
- Create a VSINSTALLDIR environment variable (System environment variable);
- Set the VSINSTALLDIR environment variable to the locations of the Microsofts Visual Studio tools and .NET Framework 2.0 (in the Common7 and SDK sub-directories of the Microsoft Visual C# 2005 Express installation, which, by default, is in
c:\Program Files\Microsoft Visual Studio 8\Common7 and c:\Program Files\Microsoft Visual Studio 8\SDK). Use quotation marks around directory names that have spaces in them. For example:
C:\apps\Microsoft Visual Studio 8
If Visual C# Express is installed in the default location (c:\Program Files\Microsoft Visual Studio 8), you do not need to create or set the VSINSTALLDIR environment variable.
To build the samples using the Visual C# 2005 Express:
- Open a Visual Studio .NET command prompt from the Windows Start Menu:
- Select Start Menu > All Programs > Visual Studio .NET > Visual Studio .NET Tools > Visual Studio .NET Command Prompt
- Navigate to the SDK\samples\DotNet directory.
- Execute Build2005.cmd:
build2005
See the Developers Setup Guide (Chapter 3, Setting Up for Microsoft C# Development) for complete information.
Running the Samples
The DotSamples can be executed from within the \bin or \debug directory of each project. You can also run the samples from within Visual Studio, at the .NET command prompt.
To display help text for any application, simply run the application without any parameters.
To run any sample from within Visual Studio:
- Launch Visual Studio.
- Open the Samples2005.sln file.
-
Set the Startup Project to any of the projects present in the solution. For example, right-mouse click on the Browser2005 Project and then select Set as Startup Project from the menu.
- Change the Project Properties to specify the command line arguments:
- From the Project menu, select Properties to display the Property Pages dialog.
- In the Project_Name Property Pages dialog, select Configuration PropertiesDebugging in the left-hand pane.
- In the right-hand pane (under Start Options), select Command Line Arguments.
- Click OK to save your changes.
- Run the sample at the command prompt.
See the Developers Setup Guide (Chapter 3, Setting Up for Microsoft C# Development) for complete information.
Sample Applications
|
Sample | Description, command-line syntax, and example... |
|
Browser |
Gets contents of the Service starting at the root folder, and prints out listing. Optionally, obtain properties for a specific type, or by default, for ManagedEntity.
Command line syntax:
Browser <webserviceurl> <username> <password> [<mo type> <property name> ...]
Examples:
Browser http://my-server/sdk myuser mypaswd
Browser http://myserver/sdk myuser mypaswd VirtualMachine name
|
|
Connect | Connects to service, logs into service, and logs out of service.
Command line syntax:
Connect <webserviceurl> <username> <password>
Example:
Connect http://my-server/sdk myuser mypaswd
|
|
EventFormat |
Retrieve and Format the latest event. Demonstrates Event formatting.
Command line syntax:
EventFormat <webserviceurl> <username> <password>
Example:
EventFormat http://my-server/sdk myuser mypaswd
|
|
SimpleClient | Code that demonstrates connecting to service, logging on to service, obtaining service content, and logging out from service.
Command line syntax:
SimpleClient <webserviceurl> <username> <password>
Example:
SimpleClient http://my-server/sdk myuser mypaswd
|
|
VmPowerOps |
Retrieves a reference to a vm and invokes various power operations on it, as specified on the command line options.
Command line syntax:
VmPowerOps <webserviceurl> <username> <password> <anyvm|namedvm> <vmname> <on|off|suspend|reset> <normal|hard|softOrFail|softOrHard> <hostname>
Example:
VmPowerOps http://my-server/sdk myuser mypaswd myWin2k3_ProductionVM on normal myhost.mycompany.com
|
|
WatchVM |
Monitors updates on a particular virtual machine using the PropertyCollector.
Command line syntax:
WatchVM <webserviceurl> <username> <password> <inventory-path-to-vm>
Example:
WatchVM http://my-server/sdk myuser mypaswd Datacenter1/vm/myvm
|
VMware Resources
Copyright © 2009 VMware, Inc. All rights not expressly granted herein
are reserved.
Last updated: 8-Dec-2008 12:30 pm | VMware vSphere Web Services SDK
|