Access Keys:
Skip to content (Access Key - 0)

Knowledgebase

Patching ZSI 2.1_a1 for caGrid

This patch is necessary for developing Python clients. Save the code below in a file called zsi.patch. Apply the patch as follows:

 > cd /usr/lib/python2.5/site-packages/ZSI
 > patch -p1 /path/to/zsi.patch 
 patching file generate/containers.py
 patching file schema.py
 patching file TCcompound.py
 patching file wstools/XMLSchema.py

zsi.patch

 diff -Naur ZSI-old/generate/containers.py ZSI/generate/containers.py
 --- ZSI-old/generate/containers.py	2008-06-17 12:37:03.000000000 -0400
 +++ ZSI/generate/containers.py	2008-06-17 12:30:47.000000000 -0400
 @@ -2389,14 +2389,14 @@
          # anyType, arrayType, etc...
          if base is None:
              base = derivation.getAttributeQName('base')
 -            if base is None:
 -                raise ContainerError, 'Unsupported derivation: %s'\
 -                        %derivation.getItemTrace()
 -                        
 -            if base != (SOAP.ENC,'Array') and base != (SCHEMA.XSD3,'anyType'):
 -                raise ContainerError, 'Unsupported base(%s): %s' %(
 -                    base, derivation.getItemTrace()
 -                    )
 +#            if base is None:
 +#                raise ContainerError, 'Unsupported derivation: %s'\
 +#                        %derivation.getItemTrace()
 +#                        
 +#            if base != (SOAP.ENC,'Array') and base != (SCHEMA.XSD3,'anyType'):
 +#                raise ContainerError, 'Unsupported base(%s): %s' %(
 +#                    base, derivation.getItemTrace()
 +#                    )
                  
          if base == (SOAP.ENC,'Array'):
              # SOAP-ENC:Array expecting arrayType attribute reference
 diff -Naur ZSI-old/schema.py ZSI/schema.py
 --- ZSI-old/schema.py	2008-06-17 12:37:03.000000000 -0400
 +++ ZSI/schema.py	2008-06-17 13:24:25.000000000 -0400
 @@ -349,7 +349,10 @@
      
      def _reveal_type(self):
          if self.__cache is None:
 -            self.__cache = self.klass(pname=self.pname, 
 +            reconstruct_pname = self.pname
 +            if self.nspname:
 +                reconstruct_pname = (self.nspname,self.pname)
 +            self.__cache = self.klass(pname=reconstruct_pname,
                              aname=self.aname, minOccurs=self.minOccurs, 
                              maxOccurs=self.maxOccurs, nillable=self.nillable, 
                              **self.__kw)
 diff -Naur ZSI-old/TCcompound.py ZSI/TCcompound.py
 --- ZSI-old/TCcompound.py	2008-06-17 12:37:03.000000000 -0400
 +++ ZSI/TCcompound.py	2008-06-17 13:10:19.000000000 -0400
 @@ -55,19 +55,19 @@
   
      # Global Element Declaration
      if isinstance(sub, ElementDeclaration):
 -        if (typecode.nspname,typecode.pname) == (sub.nspname,sub.pname):
 -            raise TypeError(\
 -                'bad usage, failed to serialize element reference (%s, %s), in: %s' %
 -                 (typecode.nspname, typecode.pname, sw.Backtrace(elt),))
 +#        if (typecode.nspname,typecode.pname) == (sub.nspname,sub.pname):
 +#            raise TypeError(\
 +#                'bad usage, failed to serialize element reference (%s, %s), in: %s' %
 +#                 (typecode.nspname, typecode.pname, sw.Backtrace(elt),))
  
          # check substitutionGroup 
          if _is_substitute_element(typecode, sub):
              return sub
  
 -        raise TypeError(\
 -            'failed to serialize (%s, %s) illegal sub GED (%s,%s): %s' %
 -             (typecode.nspname, typecode.pname, sub.nspname, sub.pname,
 -              sw.Backtrace(elt),))
 +#        raise TypeError(\
 +#            'failed to serialize (%s, %s) illegal sub GED (%s,%s): %s' %
 +#             (typecode.nspname, typecode.pname, sub.nspname, sub.pname,
 +#              sw.Backtrace(elt),))
  
      # Local Element
      if not isinstance(typecode, AnyType) and not isinstance(sub, typecode.__class__):
 diff -Naur ZSI-old/wstools/XMLSchema.py ZSI/wstools/XMLSchema.py
 --- ZSI-old/wstools/XMLSchema.py	2008-06-17 12:37:03.000000000 -0400
 +++ ZSI/wstools/XMLSchema.py	2008-06-17 12:38:39.000000000 -0400
 @@ -2468,7 +2468,10 @@
              self.annotation = Annotation(self)
              self.annotation.fromDom(contents[indx])
              indx += 1
 -            component = SplitQName(contents[indx].getTagName())[1]
 +            if indx < len(contents):
 +                component = SplitQName(contents[indx].getTagName())[1]
 +            else:
 +                component = None
  
          self.content = None
          if component == 'simpleContent':
Last edited by
Saba Bokhari (70 days ago) , ...
Adaptavist Theme Builder Powered by Atlassian Confluence