-- If one tries to grab a schema item using the helper methods, if that item doesn't exist and the namespace is not in the BUILT_IN_NAMESPACES list then throw a SchemaError. Now failure to specify an import dependency will result in an error like:
ZSI.wstools.XMLSchema.SchemaError: schema "urn:webservices" does not import namespace "urn:base"
when "item.getTypeDefinition()" is called and the "type" attribute value QName is in a namespace that hasn't been declared as a dependency
So basically this throws errors when can't find a schema item that is supposed to be defined, rather than just returning None most of the time, which is always an error condition.
M a Utility.py
-- use M2Crypto if available for TimeOutSocket, and standard "ssl" if it's not
--
Committing in .
Modified Files:
ZSI/wstools/Utility.py -- add little check for None
$ wsdl2py.py -f authority.xml.html
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.4/bin/wsdl2py.py", line 7, in ?
execfile(__file__)
File "/Users/boverhof/Desktop/Workspace/Python/zsi/scripts/wsdl2py.py", line 196, in ?
main()
File "/Users/boverhof/Desktop/Workspace/Python/zsi/scripts/wsdl2py.py", line 183, in main
wsm.writeClient(fd)
File "/Users/boverhof/Desktop/Workspace/Python/zsi/ZSI/generate/wsdl2python.py", line 211, in writeClient
sd.fromWsdl(service, **kw)
File "/Users/boverhof/Desktop/Workspace/Python/zsi/ZSI/generate/wsdl2python.py", line 273, in fromWsdl
self.locator.setUp(service)
File "/Users/boverhof/Desktop/Workspace/Python/zsi/ZSI/generate/containers.py", line 331, in setUp
info = (p.getBinding().getPortType().name, p.getBinding().name, ab.location)
File "/Users/boverhof/Desktop/Workspace/Python/zsi/ZSI/wstools/WSDLTools.py", line 1106, in getBinding
return wsdl.bindings[self.binding]
File "/Users/boverhof/Desktop/Workspace/Python/zsi/ZSI/wstools/Utility.py", line 1169, in __getitem__
return self.data[nsuri][name]
KeyError: u'http://www.omg.org/LSID/2003/AuthorityServiceSOAPBindings'
----------------------------------------------------------------------
Committing in .
Modified Files:
ZSI/TCapache.py ZSI/TCcompound.py ZSI/TCtimes.py ZSI/writer.py
ZSI/generate/wsdl2dispatch.py ZSI/wstools/Utility.py
-- finished the _get_idstr conversion, and added a "createMethodBody"
method to wsdl2dispatch.WSAServiceModuleWriter which is now called
in "setUp".
----------------------------------------------------------------------
Modified Files:
Utility.py
-- created a new func "basejoin" for python2.3, because python2.3
and python2.4 have different implementations(python2.3 is broke in
it's handling of current directory ./ ).
WSDLTools.py
-- fixed problem with wsdl:imports in WSDLTools.load, need to
_import all <wsdl:import>'s then check again if any <wsdl:import>'s
were added to main document and do again and again. Also fixed
problem with assigning base locations to these <wsdl:import>'s.
-- Remove all <wsdl:import>'s after they have been processed, or
deemed to be redundant.
-- grab basejoin from wstools.Utility
XMLSchema.py
-- grab basejoin from wstools.Utility
----------------------------------------------------------------------
Modified Files:
Utility.py -- need to do isfile check before calling mod func
"urlopen" for cross-platform compat.
----------------------------------------------------------------------
Modified Files:
Utility.py -- change to accomodate writing out XML instances
w/o SOAP Envelopes, "known" prefixes aren't "known"
when the Envelope isn't writen out.
----------------------------------------------------------------------
Modified Files:
** removed all "imports" of ZSI or ZSI.wstools, so wstools
can be used independently by SOAPpy.
Namespaces.py
-- added a namespace
Utility.py
-- moved ZSI.utility here, and the "Base" class for logging.
WSDLTools.py
-- added a "toDom" and "GetWSDL" methods to several classes,
so now you can construct a WSDL instance and then call
WSDL.toDom() --> DOM --> and create a WSDL file.
__init__.py
-- removed "Base" class for logging.
Added Files:
c14n.py
-- moved the c14n stuff from ZSI.compat here.
----------------------------------------------------------------------
Modified Files:
Utility.py -- catch any exceptions thrown when a DOM is loaded up,
throw a ParseError with old ex.args and inform which file
caused the problem.
XMLSchema.py -- For attributeGroup incorrectly adding global
attribute declarations, but these are declared locally.
----------------------------------------------------------------------
Modified Files:
Utility.py
XMLSchema.py -- just moved SplitQName out of here and into Utility
Added Files:
Namespaces.py -- WSDL, SOAP, SCHEMA, XMLNS namespaces here. Doesn't
require PyXml
----------------------------------------------------------------------
Modified Files:
Utility.py
-- Fix to DOM singleton hasAttr method. _attr and _attrNS are
instance variables of the minidom Element, and are implementation
specific. Now hasAttr method will work when using FtNode.Element,
which is what ZSI ParsedSoap defaults to (Ft.Doc).
----------------------------------------------------------------------
Modified Files:
Utility.py -- added a CollectionNS class that keys items via
(targetNamespace, name).
WSDLTools.py --
Made WSDL Collections into CollectionNS instances,
this fixes problem with collisions, caused by wsdl:imports,
between items with same name but defined in different
targetNamespaces. So now all items can be accessed via
(namespace,name), but ONLY those items defined in
WSDL.targetNamepsace (not an import.targetNamespace) can
be accessed using just 'name'.
Also changed how portType is "loaded". Now instead of
dropping all the operation nodes in "load", I drop
the portType node into "load". This makes sense because
portType really should know about itself, and the
XML Schema definition of "portType" includes an "anyAttribute"
and I need to make this stuff available. I may change the
other WSDL information items to do this to be consistent.
----------------------------------------------------------------------
Modified Files:
Utility.py -- fixed bug in _clone_node patch. This method
was being called with qualifiedName for namespaced attributes,
and bombing. It is supposed to be called like so:
getAttributeNodeNS(self, namespaceURI, localName)
Really could remove the if/else clause here but I
decided to leave it there just to keep the 3 distinctions
in the code.
----------------------------------------------------------------------
Modified Files:
Utility.py
WSDLTools.py
XMLSchema.py
-- Fixed [ 810251 ] default method broken in wstools.Utility.Collection
-- Also fixed problem with includes Collection key, and changed
Types(Collection) class to declare a different default key instead
of redefining several methods.
----------------------------------------------------------------------
Modified Files:
Utility.py -- Added a parameter to Collection class constructor,
'name' is the default attribute used for keys but one
can specify whatever key they want.
XMLSchema.py -- Used the above parameter to make Collection
instances use the appropriate 'attribute' as key.
----------------------------------------------------------------------
I fixed that fact that Notation and Entity were not be found. I changed them
to use the qualified name like the rest of the symbols from xml.dom.minidom.
I also discovered that a RecursionError was being thrown, but RecursionError
didn't exist. I created simple sub-class of Exception to rectify this.