Error code: 400 back when create user on the Organization
I write a simple php code that use the createUser function to create a new user on the body. The following error appears:
"POST ". https://xx.XX.XX.XX/API/v1.0/Admin/org/1421086956/users failed, return code: error 400,:, request data: User_Full_Name " [email protected] true Pa55w0rd '
What does this error mean?
Here is my code:
/** * Function to create a VMware_VCloud_API_UserType data object. */ function createUserObj($userName, $password, $role=null, $isEnabled=null, $fullName=null, $emailAddress=null, $description=null) { $obj = new VMware_VCloud_API_UserType(); $obj->set_name($userName); $obj->setFullName($fullName); $obj->setDescription($description); $obj->setPassword($password); $obj->setRole($role); $obj->setIsEnabled($isEnabled); $obj->setEmailAddress($emailAddress); return $obj; } /** * Create a new user on an existing organization. */ try { // create a service object $service = VMware_VCloud_SDK_Service::getService(); // login to the service portal, $service->login($server, $auth, $httpConfig); // create an SDK Admin object $sdkAdmin = $service->createSDKAdminObj(); // get references to administrative organization entities $adminOrgRefs = $sdkAdmin->getAdminOrgRefs('testOrg1'); // testOrg1 Organization are already created. // create SDK AdminOrg object $sdkAdminOrg = $service->createSDKObj($adminOrgRefs[0]); // get references to roles $adminRoleRefs = $sdkAdmin->getRoleRefs('Organization Administrator'); // create a VMware_VCloud_API_UserType data object $userObj = createUserObj('API_Sample_user', 'Pa55w0rd', $adminRoleRefs[0], true, 'User_Full_Name', '[email protected]'); // invoke createUser function on an SDK AdminOrg object $user = $sdkAdminOrg->createUser($userObj); // Print user list $userList = $sdkAdminOrg->getUserRefs(); echo "<br> User List <br>"; foreach ($userList as $user) { echo "{$user->get_name()} <br>"; } } catch (Exception $e) { echo $e->getMessage() . "\n"; }
Error code 400 is the standard HTTP status code, indicating the incorrect query.
The problem is when you get a role of reference, the XML tag for this reference is "RoleReference".
When you create a user, the XML tag that is expected for the role reference is 'Role '.
So after getting the reference to the role of the admin vCloud (VCloudType) object.
$adminRoleRefs = $sdkAdmin-> getRoleRefs ('organisation administrator');
the user must make one more step to convert the tag.
There are two ways to do this:
1. with the help of $adminRoleRefs [0]-> set_tagName ('Role');
or
2. with the help of VMware_VCloud_SDK_Helper::createReferenceTypeObj ($adminRoleRefs [0]-> get_href());
I will record a bug in development of the SDK for this question.
Thank you
Kimberly
Tags: VMware
Similar Questions
-
I tried several times to automatically install these updates without success. Any suggestion would be appreciated! Thank you.
Sorry, you have problems getting your patches installed. I have a number of things for you to look at. First of all, are your Windows Update and the Background Intelligent Transer Services set to Automaticand started . You can check these settings by typing services.msc in the search box of the start menu.
Sometimes in order to get patches to install correctly, you must perform these tasks manually.
(1) Download Center to visit Microsoft: http://www.microsoft.com/downloads/en/default.aspx.
(2) search for each update code that begins with the letters "KB" and followed by a set of numbers (i.e. KB979309).
3) click on the link for the download and then click on download and run. You must accept the agreement of contract and then click on continue.
(4) repeat this process for each download of updates Windows could not install.
(5) to rerun the update from Microsoft, click find updates. If all goes well, it will show that you are completely patched.If this does not work, try to run the Microsoft OneCare safety scanner. Sometimes it will solve problems of hidden registry, or erase viruses can prevent the installation of patches: http://onecare.live.com/site/en-us/center/whatsnew.htm. Click full service scan, and then Quick scan (full scan takes a long time to complete). Try the patches.
See you soon,.
Barbara
-
Watch ABC app will not allowed to view episodes of TV and get error code 400-1
My provider has recently changed from Verizon FIOS to Frontier communications. Since this change I can no longer watch the ABC shows on my iPad app and receive the error code 400-1. What can I do to fix this?
You may need to update your login information in the application to reflect the new provider.
Your new Pact include internet access, often named something cute like TV on the go, Quantum, etc.. ?
Complain to the border?
Your message is appeared in the AppleTV forum. Posted in iPad?
-
Error code received 646 when trying to install update KB981715
Error code reveived 646 when trying to install update KB981715. If the automatic update is enabled, why should I even receive an answer?
Common problem. Download the updated Office and install it manually.
Save it to a location on your hard drive, you can find and then manually install it.
TaurArian [MVP] 2005-2010 - Update Services
-
I tried to install Windows Vista SP1 since July without success. I stopped trying in October but just tried it once more and I get the error code 8024200d message when it fails to install.
See this previous thread on the problem: http://www.google.com/search?hl=en&safe=off&rls=com.microsoft: en - US & q = + site: social.technet.microsoft.com + 8024200d & ei = hkchS4O6M9HolAfh8viLCg & a = X & oi = forum_cluster & resnum = 1 & ct = more results, & ved = 0CA0QrQIwAA
Unlimited installation and compatibility for Vista SP1 support is available free of charge from April 2008, through June 30, 2009. This support now will cost $59 us $ (or more) per incident.
Good luck!
~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft
-
I am trying to install a new printer. I get an error code 80072EFD of # when I try to download the software. How can I fix it?
See if this article is of no help:
"You may experience some temporary connection errors when you use Windows Update or Microsoft Update to install updates"
<>http://support.Microsoft.com/kb/836941 >HTH,
JW -
details of error: code 80071a 91 when you try to install the 'a security update for windows vista (kb2855844).
does anyone know how to go beyond this error?
Thank you.
Moved from Vista to install, upgrade and activate Forum.
Take a look at this thread:
-
try to do an update and it gives me an error code 80240016 and when i run Microsoft solve this trobuleshooter it does not work and tells me an occure\red error. How can I fix it?
Hello
1. what patch did you try?
2. update you are trying to install?Method 1:
You can follow the steps in troubleshooting this article and check:
Problems with installing updates
http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-installing-updatesMethod 2:
You can also try the steps from the link:
Windows Update, error 80240016
Error message when you try to install the updates on the Windows Update Web site or the Microsoft Update Web site: "0 x 80240016.
http://support.Microsoft.com/kb/957307Method 3:
You can also perform a clean boot, and then try to install and check.
How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
http://support.Microsoft.com/kb/929135
Note: After a repair, be sure to set the computer to start as usual as mentioned in step 7 in the Knowledge Base article. -
'ERROR 8024200d' this is the error code I get when I try to run Windows update
code 8024200 D is the error code I get when I try to run Windows update. My Windows Vista computer is SP2 after you install updates.
I tried installing several times with no luck and end up with the same error code. I have "Microsoft Security Essenial" installed on the PC.
Thank you
HelloYou can follow below link that can help you to solve your problem:Windows Update error 8024200dNote: Above the article implies on error 8024200 d. -
error code 80072EFE appers when I try to download and install updates___
error code 80072EFE appers when I try to download and install updates
Hello
This rootkit has been known to cause this problem.
TDsskiller (Rootkit removal tool)
http://support.Kaspersky.com/viruses/solutions?QID=208280684Then, restart and check the updates.
To search for other malware use this online scanner:
New Vista and Windows 7 version
http://OneCare.live.com/site/en-us/Center/whatsnew.htm==================================================================
If necessary:
Run 1 SFC
Start - type this in the search box-> find CMD at the top and RIGHT CLICK – RUN AS ADMIN
Enter this at the command prompt - sfc/scannow
How to analyze the log file entries that the Microsoft Windows Resource Checker (SFC.exe) program
generates in Windows Vista cbs.log
http://support.Microsoft.com/kb/928228------------------------------------------------------
Then check out this article:
Update to install updates<-- check this="">-- check>
http://support.Microsoft.com/kb/836941Do these two and try updates
Description of the update tool of the system for Windows Vista, Windows Server 2008, for Windows
Server 2008 R2 Release Candidate for Windows 7 Release Candidate
http://support.Microsoft.com/kb/947821/How to reset the Windows Update components? -a Mr Fixit
http://support.Microsoft.com/kb/971058=============================================
If necessary you can incident free get reports however the above should take care of it for you.
Windows updates - free Incident report
Go here and click on-> Windows Update fails while searching, downloading or installation of updates
http://support.Microsoft.com/GP/wusupport#tab3The security updates, you can get free support Incident report
http://www.Microsoft.com/protect/resources/support.aspxI hope this helps and happy holidays!
Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.
-
Hey, I have a laptop of dell 14zxps with windows 7... I get the error code 43 problem when I connect my USB to my laptop... n this laptop is designed in a way where the battery cant b removed... Please help me on how my USB is started again here... Thank you :D
Try this.
-
Nice day
Busy establishing an agent of volume app and get the error below.
Manager error 'fqdn.com' (error code 400):
Could not locate the machine making this query on the hypervisor
No idea what this may cause?
The facility is brand new for the app Manager and agent.
Thank you
Heiko
not necessarily the same cluster, but the hosts must have access to the appstacks data warehouses and the virtual machine commissioning and managed by the same vcenter
-
I have already installed creative cloud and illustrator (trial) but when I turn on the computer and restart windows, it fails with error code 16 and need me to remove the program, and reinstall.
Need help.
Hello
Please see the link below.
Hope this will help you.
Kind regards
Hervé Khare
-
Realtek card gives the error code 10 and does not work since the change of satellite
How can I fix the realtek on my computer card. It was the dial upwards, after he took off and replace it with satellite my computer wouldn't access internet
How can I fix the realtek on my computer card. He has been on dial-up, after taking if off dial-up and replaceing with satellite my computer wouldn't access internet. Noted code 10 and realtek does not work. So a please help fix me my computer.Hello
What operating system is installed on the computer?
The Code 10 error code is generated when the Device Manager has not enough information or error that spread upwards by device drivers is not recognized by Device Manager. In addition, this error may occur if one of the pilots who needs the unit does not start. If multiple drivers are used by a particular device, it can be difficult to determine which failed.
See the following article:
Description of errors related to the 10 Code that generates the Device Manager in Windows on computers
-
error code (-3212) itunes could not connect to the store, make sure your network connection is active and try again. Can someone tell me please how to do this?
Hi vivasiousv,
1 when was the last time it was working fine?
2. did you of recent changes on the computer?
See the links in the Apple Web site and try the steps mentioned below.
http://discussions.Apple.com/message.jspa?MessageID=6096760
http://discussions.Apple.com/message.jspa?MessageID=8436848
For additional support post your query in the Apple discussion.
http://discussions.Apple.com/category.jspa?categoryID=150
I hope this helps!
Halima S - Microsoft technical support.
Visit our Microsoft answers feedback Forum and let us know what you think.
Maybe you are looking for
-
Satellite A660 - 17 M - need drivers for Windows 7 32 bit
Dear all I just brought a new Toshiba Satellite A660 - 17 M in Egypt and I installed windows 7 32-bit on it to support my company work, but I could find the drivers for it on the website and many material options does not specially the extra package,
-
I can't access the BIOS to change the boot on Satellite 2410 order
I can't access the CMOS change boot priorityre. Help! Laptop Satellite S2410-504. I try normally press 'C' at startup to boot from the CD-ROM. but it does not work.F12 do not help too.I think that some define some password on HWUtility, but how to di
-
What is the best? Windows 7 or vista
Which of the two above gives fewer complications? These days most people are turning to Windows 7. is it useful?
-
Install HP laserjet 1300 Windows XP, SP3,
When you try to install the HP Laserjet 1300 on Windows XP, SP3, I get an error message and the process rollsback. The message is "Cannot install this hardware there was a problem installing this hardware, HP LASERJET 1300 PCL 6, an error occurred d
-
Want to download Personal Web Server for Windows Vista
Hello, where can I download Personal Web Server for Windows Vista Home Premium 32-bit? I can only find downloads for Win - 98. Thanks for any help.