kartagis / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

Can't load vmware wsdl #95

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Try to load a VMware VSphere wsdl

What is the expected output? What do you see instead?

You can't load the wsdl due to the import function in the service portion of 
the wsdl.

In [5]: client = 
pysimplesoap.client.SoapClient(wsdl="https://vmwareserver/sdk/vimService.wsdl",t
race=True)
{'ports': {}}
[u'port']
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-5961424445eb> in <module>()
----> 1 client = 
pysimplesoap.client.SoapClient(wsdl="https://vmwareserver/sdk/vimService.wsdl",t
race=True)

pysimplesoap/client.pyc in __init__(self, location, action, namespace, cert, 
trace, exceptions, proxy, ns, soap_ns, wsdl, cache, cacert, sessions, 
soap_server, timeout, http_headers)
    136
    137         # parse wsdl url
--> 138         self.services = wsdl and self.wsdl_parse(wsdl, debug=trace, 
cache=cache)
    139         self.service_port = None                 # service port for late binding
    140

pysimplesoap/pysimplesoap/client.pyc in wsdl_parse(self, url, debug, cache)
    488                 serv['ports'][port['name']] = bindings[binding_name]
    489
--> 490         for binding in wsdl.binding:
    491             binding_name = binding['name']
    492             if debug: log.debug("Processing binding %s" % service_name)

pysimplesoap/pysimplesoap/simplexml.pyc in __getattr__(self, tag)
    348     def __getattr__(self, tag):
    349         "Shortcut for __call__"
--> 350         return self.__call__(tag)
    351
    352     def __iter__(self):

pysimplesoap/pysimplesoap/simplexml.pyc in __call__(self, tag, ns, children, 
root, error)
    344                 namespaces_map=self.__namespaces_map)
    345         except AttributeError, e:
--> 346             raise AttributeError(u"Tag not found: %s (%s)" % (tag, 
unicode(e)))
    347
    348     def __getattr__(self, tag):

AttributeError: Tag not found: binding (No elements found)

vimService.wsdl:

<!--
Copyright 2005-2012 VMware, Inc. All rights reserved.
-->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:interface="urn:vim25" 
targetNamespace="urn:vim25Service">
<import location="vim.wsdl" namespace="urn:vim25"/>
<service name="VimService">
<port binding="interface:VimBinding" name="VimPort">
<soap:address location="https://localhost/sdk/vimService"/>
</port>
</service>
</definitions>

the binding tag is in the vim.wsdl, but it's too large to post the text here.  
You can download the wsdl's from the vsphere sdk on vmware's site.

What version of the product are you using? On what operating system?

 13 "Pythonic simple SOAP Client implementation"
 14
 15 __author__ = "Mariano Reingart (reingart@gmail.com)"
 16 __copyright__ = "Copyright (C) 2008 Mariano Reingart"
 17 __license__ = "LGPL 3.0"
 18 __version__ = "1.07a"

osx 10.8

Original issue reported on code.google.com by leph...@gmail.com on 5 Apr 2013 at 2:33

GoogleCodeExporter commented 8 years ago
Can you attach a sample python file with the wsld?
A zip or similar is enought, or you can also attach them individually.

That would help to save some time and speed up the creation of the potential 
fix.

Also, it will be used as a unit test case to prevent this happening again.

Thanks!

Original comment by reingart@gmail.com on 5 Apr 2013 at 3:53

GoogleCodeExporter commented 8 years ago
The soap server for vmware is already hosted for you, so the wsdl is on thier 
service.  I did attach the wsdl for you though.

All i did was:

import pysimplesoap.client
client = 
pysimplesoap.client.SoapClient(wsdl="https://vcenter.server.com/sdk/vimService.w
sdl",trace=True)

Let me know if there's anything more I can help out with.

Original comment by leph...@gmail.com on 5 Apr 2013 at 6:03

Attachments:

GoogleCodeExporter commented 8 years ago
This should be fixed in trunk (version 1.11, revision a16a09aa50ea):

https://code.google.com/p/pysimplesoap/source/detail?r=a16a09aa50ea01544ed7e5439
dfb63bed65bf8a8

test pending...

Original comment by reingart@gmail.com on 29 Aug 2013 at 8:36

GoogleCodeExporter commented 8 years ago
test added in revision d2d9ce804952 , but it needs a real vmware server to test 
it...

Original comment by reingart@gmail.com on 13 Sep 2013 at 6:08

GoogleCodeExporter commented 8 years ago

Original comment by reingart@gmail.com on 22 Jan 2014 at 2:07