VMware {code} Community
miff2000
Contributor
Contributor

Login authentication using vSphere MOB

Hi

I'm not too familiar with the VMware forums but I did try searching for my question previously without any useful results...

I'm automate tasks and retrieve information from the Web Service located on http://<IP-ADDRESS>/sdk using SOAP, and have have had limited success.  I'm coding in PHP and using the nuSoap library to connect.  Due to this, I've tried to get down to brass tacks and replicate the same using the Managed Object Browser (http://<IP-ADDRESS>/mob), but this is yielding the same problems.

I connect using a web browser, invoke the RetrieveServiceContent method and I'm displayed information about the vSphere server.

I then go to SessionManager and choose the Login method, enter the same userName and password that I connect to Windows with, but it fails with InvalidLogin.  The URL I'm connected to at this point is http://<IP-ADDRESS>/mob/?moid=SessionManager&method=login

I've searched around on Google for the last 3 days and I've seen loads of people who can connect using this method (albeit scripted through SOAP), but I can't seem to log in.  The credentials are correct, exactly the same as I use to access vSphere through Web Access and the desktop client.

I just can't see what I'm doing wrong.  Should I be encrypting the password?  I've tried adding the domain to the userName part, but to no avail.

Even checking on here (http://vmware.co.za/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.SessionManager.html#log...) doesn't provide any more info.

Any ideas?

Thanks in advance

Reply
0 Kudos
3 Replies
Andreas_Diemer
Enthusiast
Enthusiast

Hi Miff2000,

I've also had problems using nusoap with PHP for vCO SOAP connection - auth errord. After checking WWW with similar problems I just used a XAMPP to test the SOAP client in this apache server and voila my PHP runs.

If you stay to your credentials and code 😉 just test another client beside nuSOAP.

Regards, Andreas

------ for correct and / or useful answers please award points visit http://www.vcoteam.info & http://mighty-virtualization.blogspot.com
miff2000
Contributor
Contributor

Okay thanks, that's useful to know!

I still can't understand why using the MOB (VMware's own Managed Object Browser) to replicate the steps doesn't work through..?

Surely using the MOB would eliminate any SOAP issues wouldn't it?

Reply
0 Kudos
tos2k
Expert
Expert

Yes, I think you are right.

Anyway, I think MOB is not for automated programmatical use intentionally.

The is what the webservice is for.

Tos2k

Reply
0 Kudos