pages

Thursday, January 13, 2011

vCO - SOAP connect via VB .NET

Last week i try to build a Win32 application, based on the vCenter Orchestrator WSDL interface. In my case i try to develop an administrator interface which allows external administrators (external locations and so on) to start defined workflows with defined input parameters, like a vSphere Client for automation tasks.

After the successful evaluation i wrote the following instruction:

At first I install the newest version of Visual Studio 2010 Express Editions on my notebook and create a new Windows-Forms project. After the creation of an empty project you have to add a webservice reference, cause the vCenter Orchestrator WSDL interface is web-based. This is done by a right mouse click on the root folder of your project (in my case SOAPvCO).












In the sub-menu you will find an option called "Add Service Reference". After clicking the "Advanced" option and the WebService Reference button you can add the local WSDL path of your vCenter Orchestrator and rename it how you want it (in my case vCOref).








After the service reference is created all necessary methods and attributes are available in Visual Studio object browser. Now you can create a simple form in like this:














The basic elements are a textbox (multiline), a connect button (name=ButtonConnect) and an exit button (name=ButtonExit) to close the application. By doing a double click the connect button you will get the code window of the form. As you can see, the sub (ButtonConnect_Click) is created automatically. In this code window you have to create the following code (sorry for the screenshot, but only self-writing teaches!).


















In this simple example the connection parameters are asked with simple input boxes and written into string variables. The most important part is the declaration of "SOAP" as vCOref(our reference).VSOWebControlService(default class for new service) above the sub routines. With this definition above you can now use the "SOAP" constructor for the full form.

When debugging the project, the result should look like:













As you can see, the connection was successful and the number of workflow are shown. With this basic you can start to build up some stuff especially for your needs.

Feel free to ask any questions if you want to know more about the possibilities.

5 comments:

  1. If you like sysadmin-like tasks and work environment, and find databases intrinsically fascinating, becoming a DBA (Database Administrator) is a possible career path. You’ll need significant SQL skills in a specific direction.

    dotnet training in chennai

    ReplyDelete
  2. One of the better high level explanations I've seen. Thanks.
    Best Selenium Training in Chennai

    ReplyDelete
  3. I really enjoyed while reading your article, the information you have mentioned in this post was damn good. Keep sharing your blog with updated and useful information.
    We also providing .net certification training gurgaon

    ReplyDelete

  4. Learned a lot of new things from your post ,It's amazing blog
    .Net Online Training

    ReplyDelete