VirtualBox

Ignore:
Timestamp:
Mar 11, 2009 11:45:18 AM (16 years ago)
Author:
vboxsync
Message:

webservice: fix perl sample + documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/webservice/samples/perl/clienttest.pl

    r16122 r17681  
    33#
    44# This little perl program attempts to connect to a running VirtualBox
    5 # webservice and calls various methods on it.
    6 #
    7 # To get this to run:
    8 #
    9 # 0) If not yet among perl's modules, install SOAP::Lite. Users of debian
    10 #    based systems might try 'sudo apt-get install libsoap-lite-perl'.
    11 #
    12 # 1) In this directory, run
    13 #    stubmaker file:///path/to/sdk/bindings/webservice/vboxwebService.wsdl
    14 #    Note: the command is named stubmaker.pl on some systems.
    15 #    stubmaker should be installed on your system if you have SOAP::Lite and
    16 #    will, after a little while of thinking, create a vboxService.pm
    17 #    file in the current directory, which the "use" statement below
    18 #    then includes.
    19 #
    20 #    (SOAP::Lite supports parsing the WSDL file on every run of
    21 #    the script, but it takes up to a minute to do so, hence the external
    22 #    variant via stubmaker.pl here.)
    23 #
    24 # 2) Start vboxwebsrv.
    25 #
    26 # 3) Run this script.
    27 #
     5# webservice and calls various methods on it. Please refer to the SDK
     6# programming reference (SDKRef.pdf) for how to use this sample.
    287#
    298# Copyright (C) 2006-2009 Sun Microsystems, Inc.
     
    4423use strict;
    4524use SOAP::Lite;
    46 use vboxService;
     25use vboxService;    # generated by stubmaker, see SDKRef.pdf
    4726use Data::Dumper;
    4827
     
    10382{
    10483    print "[$cmd] Listing machines:\n";
    105     my $result = vboxService->IVirtualBox_getMachines($vbox);
    106     foreach my $idMachine (@{$result->{'array'}})
     84    my @result = vboxService->IVirtualBox_getMachines2($vbox);
     85    foreach my $idMachine (@result)
    10786    {
    10887        my $if = vboxService->IManagedObjectRef_getInterfaceName($idMachine);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette