VMware {code} Community
maciej_wos
Contributor
Contributor

vimService.wsdl configuration

Hello. I'm trying to create a client for the SDK. I was trying to get it working with pure Python and SOAPpy rather than using IronPython and .Net.

However, I'm not sure how should I configure the server, i.e. do I have to change the vimService.wsdl file?

By default it is as follows:

Clearly localhost does not make any sense. Also, why is it pointing to /vimService if the binding is /sdk?

But no matter how I try to change it I'm still having problems (I change the local copy that I use to generate stubs). Shall I change it on the server too? Or anything else?

Reply
0 Kudos
6 Replies
ShortWave
Contributor
Contributor

The answer is: Yes, if your python client is going to be located on another machine (or in a virtual machine), then you need to specify the hostname of the esx server in question.

If your python client is running on the esx server itself, localhost will work fine.

Hope this helps

p.s. I'm experimenting with SOAPpy/ZSI myself, and finding it somewhat troublesome to get configured because of the custom namespaces that are used.

Reply
0 Kudos
maciej_wos
Contributor
Contributor

How do you configure it?

I'm doing the programming bit - don't really have a clue about vmware administration.

Also - I couldn't get neither SOAPpy nor ZSI to work... I have no idea why. All I get is 'connection refused'. If you had better luck with this, please let me know what to do.

Reply
0 Kudos
rinf
Contributor
Contributor

I had the same problem.

I got this great code for using the VMware VI SDK 2.0 using Python 2.4 and Zolera Soap Infrastructure(ZSI) 2.0 after a lot of googling.

Read the comments in the beginning of the code to generate the Client Stubs and it also gives a tells you how to fix a bug in ZSI 2.0

The python code logs into a VIM Service of ESX or VirtualCenter, Retrieves Host Properties etc and Logs out.

I guess you can figure out the rest by reading the API. The easiest way to understand how ZSI works is to read the python code and compare it to an equivalent api example call in Java or .Net and see how ZSI SOAP calls are structured and you can figure out the rest.

Reply
0 Kudos
marcodemarco
Contributor
Contributor

Hi,

I've run the code posted into the forum, and it works well. I've compared the python code with the equivalent api example in java and it's not so clear how the calls work. I've also read the client stub code generated by the wsdl2py. I guess someone can link a guide, howto or other code.

TNX

Reply
0 Kudos
angusmojo2008
Contributor
Contributor

Doing wsdl2py on vimService.wsdl of vSphere 4.1 SDK works only on vim namespace and not on vim25 for me.

I've got the following error using this command line wsdl2py -l -b -d vimService.wsdl within vim25 directory of the SDK:

File "build/bdist.linux-i686/egg/ZSI/wstools/XMLSchema.py", line 81, in __setIncludes

schema.addIncludeSchema(schemaLocation, self._imports[schemaLocation])

KeyError: u'core-types.xsd'

This command line works perfectly within the vim directory (but it's not useful for me as I'd like to have all new stuff from vim25).

Any idea?

I'm using recommended ZSI 2.1a1 w/ patch recommended.

Thanks in advance.

Reply
0 Kudos
angusmojo2008
Contributor
Contributor

bump.

any idea?

TIA

Reply
0 Kudos