Hi all,
I am trying to do simple login to chargeback 1.0.1. I am using the sample code provided in "vCenter Chargeback API Programming Guide".
Also i am using the login-request.xml provided with chargeback 1.0.1 API reference. I have replaced username and password with appropriate credentials.
I am attaching my sample code and XML.
Here is the response i get if i use client version as 1.0.1
<?xml version="1.0" encoding="UTF-8"?>
<Response xmlns="http://www.vmware.com/vcenter-chargeback/v101" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" status="failure">
<Error majorErrorCode="500" minorErrorCode="7" message="http://www.vmware.com/vcenter-chargeback/v101 is not the valid namespace for the API version 1.0.1." />
</Response>
Here is the response i get if i use client version as v101
<?xml version="1.0" encoding="UTF-8"?>
<Response xmlns="http://www.vmware.com/vcenter-chargeback/v101" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" status="failure">
<Error majorErrorCode="500" minorErrorCode="7" message="v101 is an invalid API version." />
</Response>
Can anyone tell me correct client version to be used?
Thanks,
-vidya
Hi Vidya,
Please look at the 1.0.1 release programming guide at
http://www.vmware.com/support/pubs/vcbm_pubs.html
You need to use XML as
<?xml version="1.0" encoding="UTF-8"?>
<Request xmlns="http://www.vmware.com/vcenter/chargeback/1.0.1">
<Users>
<User>
<Type>local</Type>
<Name>TestUser</Name>
<Password>SomePassword</Password>
</User>
</Users>
</Request>
And client version as 1.0.1
Please let us know if you have any issues after trying out this.
Regards,
Hemanth
Hi Vidya,
Please look at the 1.0.1 release programming guide at
http://www.vmware.com/support/pubs/vcbm_pubs.html
You need to use XML as
<?xml version="1.0" encoding="UTF-8"?>
<Request xmlns="http://www.vmware.com/vcenter/chargeback/1.0.1">
<Users>
<User>
<Type>local</Type>
<Name>TestUser</Name>
<Password>SomePassword</Password>
</User>
</Users>
</Request>
And client version as 1.0.1
Please let us know if you have any issues after trying out this.
Regards,
Hemanth
Thanks Hemanth for the prompt reply.
I just figured it out and moved ahead. But now stuck another issue -
Though I am passing Type in the request, it's saying "Type" is not found the XML -
Regards,
Vidya Vadke.
Vidya,
Please let us know the API you are trying, request URL and XML as well.
Regards,
Hemanth
Hi Hemanth,
I used the XML in your post. And it worked.
Thanks.
-Vidya
Hi Hemanth,
I compared the two XMLs. The one which I used before, from API reference sample, contained <APIs><API id="login"> tags which are not there in the XML you just gave me.
I was trying login api. Now I am getting authenticated using the correct xml provided by you.
Regards,
-Vidya
