Create new folder (CreateFolder method) Web Services SDK c#

Hello

Having problems in my code below. Someone help me, I really am lost, do not know what to do do.just a newbie... Here is the error.

Thank you thank you

Shim

__________________________________________

Stack trace:

[SoapException]
   System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +431678
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204
   Vim25Api.VimService.CreateFolder(ManagedObjectReference _this, String name) +123
   Nimbus.VirtualCenter.Folder.Create(String url, String usid, String pwd) in D:\projects\nimbus\sourcecode\v1\Nimbus\Nimbus.VirtualCenter\Folder.cs:40
   Nimbus.UserPage.Elementpage.TreeView.btnCreateFolder_Click(Object sender, EventArgs e) in D:\projects\nimbus\sourcecode\v1\Nimbus\Nimbus\TreeView.aspx.cs:143
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

____________________________________________

public class folder

{

public static VimService _service;

protected ManagedObjectReference _svcRef;

protected ServiceContent _sic;

private UserSession _session;

Public Sub Create (string url, string usid, string pwd) / /, string dcName)

{

String datacenterName = dcName; name of the data center

System.Net.ServicePointManager.CertificatePolicy = new CertPolicy();

Vim25Api.ManagedObjectReference _svcRef = new ManagedObjectReference();

Gets the content of the service

_svcRef.Type = "ServiceInstance."

_svcRef.value = "ServiceInstance."

_Service = new VimService();

_Service. URL = url;

_Service. CookieContainer = new CookieContainer();

Console.WriteLine ("before call:" + System.DateTime.Now.ToString ());

_Sic = service . RetrieveServiceContent (svcRef);

Console.WriteLine ("after call:" + System.DateTime.Now.ToString ());

_SESSION = service. Login (sic.sessionManager, usid, pwd, null);

service. CreateFolder (svcRef, "sample");

}

}

The CreateFolder() method must be called from the vmFolder (VM/model display) or hostFolder (cluster host/view). You must first get a reference to the specific data center, you want to create the folder and then from there, you can get access to vmFolder or hostFolder as seen from managed object data center: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.Datacenter.html

=========================================================================

William Lam

VMware vExpert 2009

Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Twitter: @lamw

repository scripts vGhetto

Introduction to the vMA (tips/tricks)

Getting started with vSphere SDK for Perl

VMware Code Central - Scripts/code samples for developers and administrators

150 VMware developer

If you find this information useful, please give points to "correct" or "useful".

Tags: VMware

Similar Questions

  • Which server to connect to with Web Services SDK?

    Is there a way to know which server to connect to when using Web Services SDK?  It must be the ESX Server virtual machine is on, I guess.  But a customer pretends that we are connect to its server vCenter Server, which I do not think that was possible. I tried to call one of the SDK sample and connect to my vCenter server, but it didn't connect. I had to connect to my server ESX or vSphere.

    We use them vSphere 4.0

    The only api vSphere is available on (i) ESX and vCenter, some things will be available on one or the other, for example, cloning is a feature of vCenter and there will be APIs that is available only when connecting to vCenter. Depending on what you're trying to run, you can be able to obtain the information by using two systems, such as the search for a virtual machine. If you manage only a single host, it is pretty trivial, but if you manage more than 20 + guests and you have vCenter, then you probably want to use vCenter.

    I don't think you understand clearly the operation of the vSphere API and what is worrying, it is that you meet your customers to run a script unknown in which they or you understand. I think that I have answered some of your questions in the past, to reiterate that if you are new to the VMware/SDK API, I would recommend that you completely cross the following document - Getting Started with vSphere SDK - Update for SDK 4.1 release

    =========================================================================

    William Lam

    VMware vExpert 2009,2010

    VMware VCP3, 4

    VMware VCAP4-DCA

    VMware scripts and resources at: http://www.virtuallyghetto.com/

    Twitter: @lamw

    repository scripts vGhetto

    Introduction to the vMA (tips/tricks)

    Getting started with vSphere SDK for Perl

    VMware Code Central - Scripts/code samples for developers and administrators

    VMware developer community

    If you find this information useful, please give points to "correct" or "useful".

  • What is the difference between "vShpere SDK ro Perl"and "vSphere Web Services SDK (for Java or c#)"?

    Hello world! I'm new to "VMware vSphere API", and I have a question to ask you to help:

    What is the difference between "vShpere SDK ro Perl"and "vSphere Web Services SDK (for Java or c#)"?

    -What are the different programming language? Is there another difference?

    I'm looking forward to your reply.

    Thank you!

    If you are new on the VMware API/SDK, highly recommend you take a look at the following: Getting Started with vSphere SDK - Update for SDK 4.1 release

    vSphere SDK for Perl is just one of the many client SDK for vSphere API that is flush with vcenter times and ESX (i) as a standard Web service.

    vSphere SDK for Java - SDK Java to vSphere API for Java developers

    vSphere SDK for Perl - Perl SDK for vSphere API for Perl developers

    vSphere SDK for c# - c# SDK for vSphere API for c# developers

    PowerCLI - PowerShell SDK for vSphere API for developers of Powershell

    I hope that makes a bit more sense

    =========================================================================

    William Lam

    VMware vExpert 2009,2010

    VMware VCP3, 4

    VMware VCAP4-DCA

    VMware scripts and resources at: http://www.virtuallyghetto.com/

    Twitter: @lamw

    repository scripts vGhetto

    Introduction to the vMA (tips/tricks)

    Getting started with vSphere SDK for Perl

    VMware Code Central - Scripts/code samples for developers and administrators

    VMware developer community

    If you find this information useful, please give points to "correct" or "useful".

  • Specific VirtualMachine counters through the Web Services SDK

    Hello

    I'm developing a monitorapp in c# with the web services SDK.

    I am able to get a list of all the performance with the PerformanceManager counters.

    ObjectContent [oCont] is getPropertyContent ("PerformanceManager", "perfCounter", _serviceContent.perfManager);.

    I ask this directly to an ESX 4.

    The answer I'll be of return contains all of the available counters, but there is no division between the host and the virtual-counter Machine.

    For example, cpu.utilization is available for the host and not a VM.

    Is it possible to know somehow what counters are specific to vm?

    I am able to get object references managed virtual machines if that's any help...

    Thanks in advance!

    Glenn

    Hi Glenn,.

    The property "perfCounter" PerformanceManager fetch all of the counters that are available in the host or vCenter. It provides no mechanism to filter counters. In order to obtain the available counters specific to a managed entity (VM, host, etc.) you must use the QueryAvailablePerfMetric method. Calling this method against MOR of the virtual machine, you will get all the ID counter for this virtual machine.

    http://www.VMware.com/support/developer/VC-SDK/visdk41pubs/ApiReference/Vim.PerformanceManager.html#queryAvailableMetric

    I hope this helps!

    Neha

  • I can't see changes in a folder unless I go up a level and then re-enter folder, for example, create new folder, rename the folder, rotate the image etc. Can someone please?

    I do not see changes within a folder, except if I go up a level and then again enter the folder, for example, create new folder, rename the folder, rotate the image, etc..

    By pressing the "F5" key would probably be to refresh the folder.

    See if this article helps you with this problem:

    "List of the files in the Windows Explorer folder is not refreshed after that you create, move, or delete files"
      <>http://support.Microsoft.com/kb/823291 >

    HTH,
    JW

  • I lost create new folder capability, windows in Windows 7 Explorer now only allows to create "new briefcases" folder instead. How to return to the good old file folder create capabilities?

    I lost create new folder capability, windows Explorer.  Windows 7 now only allows to create "new briefcases" folder instead.  I'm not sure any upgrade of MS that caused this change. I would like the pros and cons of the 'Briefcase' records and also

    How to restore or use for good old file folder create capabilities?

    See if this thread will help.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-files/unable-to-create-a-new-folder-in-Windows-7/3c5951c8-e3b0-4E5B-99A5-744f842fe558

  • With regard to the use of the web service sdk web client SDK

    Hello

    I could run the java program of the Web SDK service, independently, but how what I call web client SDK.

    Because it requires changes in environmental variables (AXIS, WBEM vars etc.) and what are all the eclipse changes required to do this?

    Help, please. Also, if you could suggest any web client sdk sample, call web service sdk, it would be a great help.

    Thank you!

    It's covered in the SDK samples, see docs/samples-doc/vsphereviews.html#vsphere-ui and samples/vsphereviews/vsphere-wssdk-provider

  • The implementation of RunProgramInGuest of VIX using the vSphere Web Services SDK?

    Hello

    A few months ago I developed a python API for VIX, but as I needed to extend the functionality of this API (performance monitoring, host management, etc.) I moved the vSphere Web Services SDK.

    However, I did find a way to implement some comments VIX as LoginInGuest or RunProgramInGuest functions using only the Web Services SDK.

    Is there a way to do this? I thought that each function VIX has been translated internally to a soap request, but now I think that is not the case for these functions of comments, if so, how VIX inwardly does them?

    Thanks for your help!

    Sebastian Tello

    Currently, if you must implement specific comments operations running a specific script/application or by connecting to a guest, you must use the VIX API. This feature is not currently exposed in the vSphere API, you will need to use a combination of both, until VMware them integrates in the vSphere API core. For more details on the future of VIX, take a look at this blog post - http://www.virtuallyghetto.com/2010/11/what-is-vmware-vix-api-and-its-future.html

  • vSphere: VI vs Web Services SDK Toolkit

    I'm looking in the development of some tools to automate my vSphere infrastructure. I intend to write code using c# and the code could potentially be placed in Windows forms, web services, etc..

    I downloaded the .NET SDK for vSphere web service and it seems to be rather too complicated to perform simple tasks like comments to restart. I also found the kit of development .NET for the VI (VMware.vim) Toolkit, which looks much simpler to use.

    Y at - there a lot of difference between the two software development kits? There that all define the reasons for choosing one over the other?

    Any help would be greatly appreciated.

    VI Toolkit 1.5: target platform: vSphere 4.0 and above, VMware Infrastructure 3.x and higher.

    Web Services SDK: target platform: 4.0 and VMware Infrastructure 3.X vSphere

    ---

    iSCSI SAN software

    http://www.starwindsoftware.com

  • Create Resource Pool c# Web Services SDK

    Hello

    I then starting in this area and I seriously need help.

    Can anyone help/provide code me by creating a resourcepool? and by creating a new folder under a resourcepool?...

    Thank you... Thank you

    Shim

    Check out this script: createResourcepool.pl

    You can certainly add the logic required to even create the folder before the list of resources, etc... but this should give you an example on how to create a resource pool.

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    Twitter: @lamw

    repository scripts vGhetto

    Introduction to the vMA (tips/tricks)

    Getting started with vSphere SDK for Perl

    VMware Code Central - Scripts/code samples for developers and administrators

    150 VMware developer

    If you find this information useful, please give points to "correct" or "useful".

  • Problem creating an account of HP Web Services

    Hi, I just brought a 4500 desire.  All the installation program has been very well and I can print and scan wireless so I'm sure the printer works.  I also activated the Web service and received a paper copy of the printer that lists the steps and the printer code.

    However, when I tried to create a new account on behalf of HP Web Services, after I entered all the required information, it still not let me go through and said "Email must match to ' and ' match of motorization of passwords '.»  So for the moment I'm not able to use eprint.

    I appreciate if anyone can help?

    I read another post with the same problem after I sent my.  I think that my problem was that IE and Chrome do not display the field "confirm your password" so that I can do it using Firefox.  If the account is created.

    Anyway, it is now resolved and thanks for your quick response.

    Thank you!

  • Is impossible to turn on the guest account. Cannot create new user account. "The service user profile Service has no logon. User profile cannot be loaded. »

    Is impossible to turn on the guest account.  Cannot create new user account.  After to try one of those and reboot, the icons of account appear, but when you try to use, the following instructions of error present when you try to log in with the new account or comments: "the user profile Service service has no logon.  User profile cannot be loaded. "I looked at the answers to all the previous ones (including the KB947215) and no not to address specifically.  For the most part, they seem to assume that there is a guest or a new profile in the first place...

    The system is Win 7 Pro 64-bit with all available updates.  I can't say when the last time that the guest account has worked (rarely used) and just found out I can't do new additional user, accounts trying to solve the problem of account of comments... so I have not tried to enter Safe Mode and do a system restore , because I can't yet identify a useful restore point...

    There are no entries in the registry for a guest or a new standard user account.  The registry entries for the three accounts normal-quickly (2 x admin, 1 x level) seem to be appropriate.  Watch register computer/HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

    S-1-5-18 = system profile

    19 = local service,

    20 = network service,

    21 long numbers + 1004 plus User1 (admin),

    22 long + 1005 plus 2 user (admin),

    23 plus long + 1006 is user3 (standard,

    and no comments or additional profiles appear.

    C:\Users includes

    All users,

    User1,

    User3,

    By default,.

    Default user (which is inaccessible for me, even as an administrator),

    Public,

    User2,

    No guest or additional profile appear.

    All except the default user (I can't open) seem to have the appropriate, NTUser.DAT files although I don't know how to check for corruption.  Having both a default value

    and a default user folder seems hokey.

    I think I understand instructions how to fix or remove a corrupted profile, but that does not apply to the guest account or profiles that do not exist.

    Help?  Ideas?

    This message contains the strange solution.

    [Plan B - I found one thread where one user said that the same symptoms of the problem that you experience this problem solved]

    - - - - - - - - - - -

    Plan h - while another user said that it was caused by a file Windows Live problem

    This is the thread I can not create a new user account (Windows 7): the user profile service service doesn't have the logon

    You find it difficult to follow the thread as it's long and reported problem by different people to confuse it and there is also a bit of bickering [long filaments often end up being quite incomprehensible].

    ..., See references to the event viewer in the middle of page 4 and Windows Live we [at the bottom of page 2 more on page 3].

    I see not the logic of the any of those things, but if one of them do things long enough that you are trying to create new accounts that works, you will know how in the future until a proper solution is found.

    This is the useful part where this user has tested the solutions proposed in this thread linked above: -.

    This has proved to contain leads to a difficulty.  Have to admit, when I read everything the first time, several days, I did indeed find it confusing and even the parts that I "heard" (sorta) does not appear to be related to my symptoms.

    It turns out that the answer of JDMICHAL May 17, 2011 contained this:

    (1) C:\Users\Default\AppData\Local\Microsoft\Windows open live
    (2) this directory has two subdirectories with a single file of each. Go into each directory and apply the following:
    (a) make a right click on the file, open the properties.
    (b) click the Security tab.
    (c) it will issue a message: "to continue, you must be an administrative user with permission to view this object's security properties. Would continue you? ». Click on the button continue.
    (d) click on the Add button...
    (e) ' everyone' type in the box at the bottom of the dialog box. Click on "check names"; It should be emphasized the "everyone". Click OK.
    (f) ensure that the new "Everyone" entry "read" and "read & run" check under the column "allow".

    After doing this for two files, attempt to connect to the account. He must undergo.

    The procedure (bascially) worked... Although the different answers on my system differed slightly along the way (perhaps due to the slightly different versions of Win 7?, because I was already logged in as an administrator?).

    In any case, "Everyone" with the read and read/execute permissions adding to these two files seems to have done the trick:

    C:\Users\Default\AppData\Local\Microsoft\Windows Live\Bici\Bici1_00.sqm

    and

    C:\Users\Default\AppData\Local\Microsoft\Windows Live\SqmApi\SqmData720896_00.sqm

    Thank you for leading me to this!

  • Is it possible to set configuration options VMsafe via vSphere Web Service SDK?

    Is it possible to define VMsafe configuration options via the web service of vSphere SDK?

    I noticed that the options in question are 'OptionValue's contained in the property config.extraConfig of the virtual machine, so I tried to edit them using the method ReconfigVM_Task of the SOAP API.

    This fails however, even if the SOAP request appears to be valid:

    & lt;? XML version = "1.0"? & gt;

    " & lt; env:Envelope xmlns:env = ' http://schemas.xmlsoap.org/SOAP/envelope/ "& gt; .

    & lt; env:header / & gt;

    & lt; env:body & gt;

    & lt; N1:ReconfigVM_Task xmlns:n1 = "urn: vim25" & gt;

    & lt; N1:_this type = 'VirtualMachine' & gt; VM - 448 & lt; / n1:_this & gt;

    & lt; N1:spec xsi: type = "VirtualMachineConfigSpec" & gt;

    & lt; N1:extraConfig xsi: type = "n1:OptionValue" & gt;

    & lt; N1:key & gt; vmsafe.enable & lt; / n1:key & gt;

    & lt; N1: value & gt; FAKE & lt; / n1: value & gt;

    & lt; / n1:extraConfig & gt;

    & lt; / n1:spec & gt;

    & lt; / n1:ReconfigVM_Task & gt;

    & lt; / env:Body & gt;

    & lt; / env:Envelope & gt;

    This query generates the following error:

    & lt;? XML version = "1.0" encoding = "UTF-8"? & gt;

    " & lt; soapenv:Envelope xmlns:soapenc = ' http://schemas.xmlsoap.org/SOAP/encoding/ "xmlns:soapenv =" " http://schemas.xmlsoap.org/SOAP/envelope/ "container =" " http://www.w3.org/2001/XMLSchema "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance "& gt; .

    & lt; soapenv:body & gt;

    & lt; soapenv:fault & gt; & lt; faultcode & gt; ServerFaultCode & lt; / faultcode & gt; & lt; faultstring & gt; invalid argument: value & lt; / faultstring & gt; & lt; retail & gt; & lt; InvalidRequestFault xmlns = "urn: vim25" xsi: type = "InvalidRequest" / & gt; & lt; / detail & gt; & lt; / soapenv:Fault & gt;

    & lt; / soapenv:Body & gt;

    & lt; / soapenv:Envelope & gt;

    For help in resolving this issue will be greatly appreciated.

    I'm glad it worked! Don't forget awareness useful or correct points

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    repository scripts vGhetto

    VMware Code Central - Scripts/code samples for developers and administrators

    http://Twitter.com/lamw

    If you find this information useful, please give points to "correct" or "useful".

  • Create new folder - Labview 7.1

    Is it possible to create the new folder Parametrically in labview 7.1? I'm modification of existing software, do not want later. It will take forever.

    I could do labview 8.5. See the attached file.

    I want a similar on Labview 7.1.

    Thank you

    Jey

    I don't understand what is the question. The function of new directory has an entry path like the function to create a folder in LabVIEW 8.5.

    The code you have posted the check if file or a folder exists function calls in LabVIEW 8.5.  Are you really asking if there is an equivalent of this for LabVIEW 7.1? This specific VI is no 7.1, but you can create easily using the File Info feature instead. You can check to see if this function returns an error, and check the error code.

  • How to create new folder Mozilla Thunderbird

    I just started using it for my emails. I have my original files from windows live, but cannot see how to create another new. Help would be very appreciated.

    Right click on a folder in the folder - new folder (or subfolder) pane

Maybe you are looking for